Sky started 32 seconds ahead of Sunweb but were unable to hold the German team off over the 50km team time trial pursuit, and were caught with 3.8km to go.
Sunweb then rode ahead of Sky and it looked like they might hold them off until the line, but the British team regrouped and close the gap ahead within the final 800 metres.
It then came down to a sprint between the fourth riders on the rode, with Tao Geoghagen Hart among three Sunweb riders able to cross the line first to give Sky the victory.
Behind Nippo - Vini Fantini, Lotto Soudal, Movistar, Cannondale-Drapac, Orica-Scott and LottoNL-Jumbo all came together after the first 14.5km lap of the circuit and eventually finished together in a sprint for the line.
Orica-Scott were the team able to take third place, but all the teams with them had spent much of the race tightly packed which is against the race's no drafting rules.
Movistar took the victory on Friday's opening climbing race while Trek-Segafredo won the sprint race on Saturday.
Hammers Series 2017
1 Team Sky, in 51-59
2 Team Sunweb, at 1s
3 Orica-Scott, at 36s
4 Lotto Soudal
5 Movistar Team, at 37s
6 Team LottoNL-Jumbo, at 39s
7 Cannondale-Drapac, at 41s
8 Nippo - Vini Fantini, at 45s
Thank you for reading 20 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1