© PA Photos
The 10 men of City still threatened, however, as Mario Balotelli danced past three defenders before stinging the palms of Foster from 10 yards.
The champions almost took the lead two minutes into the second half when Carlos Tevez struck a curling shot towards the top corner that Foster did well to claw away.
Yaya Toure squandered a golden chance from six yards out on the hour mark, and was punished with just over 20 minutes left of the match when Peter Odemwingie's strike was diverted past Hart by Long to give the hosts the lead.
Substitute Dzeko brought the scores back level in the 80th minute, however, beating Foster to Tevez's free kick.
Romelo Lukaku should have restored the Baggies' lead at the end of normal time but he directed his header straight at Hart when he should have done better.
City then did what champions do best and dug out a winner in the closing moments as Sergio Aguero fed Dzeko on the break, and the sub made no mistake to net his second of the game.