In a game played in a snow-storm before half-time, skipper Gundogan provided the decisive moment after 33 minutes when he turned home a deflected Riyad Mahrez effort at the far-post.
It was the Germany midfielder’s third goal of the season – and his second in four league games – and was followed up in the final minute by Fernandinho, who had only been introduced three minutes earlier to tie the game up.
The veteran Brazilian had not scored a Premier League goal since October 2018 but found the target from the edge of the box.
Manuel Lanzini pulled one back with the final kick of the game, which cost Ederson his 100th clean sheet in all competitions but did nothing to prevent City moving back into second spot, six points clear of the Hammers.
The Londoners remain fourth despite suffering successive Premier League defeats for the first time since April.
Man City boss Pep Guardiola, said: “The amount of chances we created, especially in the first half, in the conditions that both teams played in – it was a huge victory for us, for the effort of the players and the performance.
“We didn’t concede much. We defended the set-pieces really well and counter-attacks we controlled.
“We could maybe make another speed, another rhythm but weather conditions didn’t allow us to do it and it was a good performance from us.”
Weather main threat to City win
Guardiola offered special thanks to head groundsman Lee Jackson and his team for this latest victory.
As half-time approached with heavy snow falling on a pitch already covered in it, there was a real fear the game might not reach its conclusion.
Yet Jackson and his colleagues got to work and with the aid of a half-time interval extended by referee Michael Oliver by five minutes, and the surface was clear again when the game restarted, by which time the snow had stopped.
Guardiola said: “I think the groundkeepers, the men who took care of the pitch, were the men of the match. They did an incredible job so we could play the game today.”
Jackson’s reward was an effective home display, even if it was some way short of show-stopper.
West Ham keeper Lukasz Fabianski denied Gundogan a second and Bernardo Silva’s excellent chipped finish counted for nothing thanks to an offside flag.
And Ederson, whose only significant save was turning away a fierce Declan Rice shot, was denied his personal milestone with a goal out of virtually nothing from Lanzini, when West Ham had no time to even think about an equaliser.
Despite losing 22 out of 25 previous away games against the defending champions, West Ham can rarely have gone into such a fixture in more optimistic mood.
Yet they never really got going.
Fabianski was booed by the City fans inside the opening 10 minutes for apparent time-wasting and the experienced Poland goalkeeper was soon earning the wrath of David Moyes for a fluffed clearance that would have resulted in a goal had Mahrez not been offside when Raheem Sterling’s block landed at his feet.
Arthur Masuaku’s selection ahead of Jarrod Bowen was supposed to provide more protection down the West Ham left flank but City’s array of attacking talent just found spaces elsewhere.
Ben Johnson’s goalline clearance to deny Mahrez, who also hit the outside of the post, before half-time was followed up by Aaron Cresswell bravely sliding in to turn Gabriel Jesus’ goal-bound effort away for a corner. It was effectively Cresswell’s final contribution as he continued into the post with such force he needed to be replaced by Vladimir Coufal after hurting his back.
It made no fundamental difference to the flow of the game and West Ham will be thankful for the failings of others that their position in the table remains as it was.