City were 2-0 up within the opening 15 minutes, Nigel de Jong powering home his first goal for the club and then Pablo Zabaleta guiding a shot on target beyond Robert Green which Lars Jacobsen inadvertently blasted into the net as he attempted to kick the ball away.
The Hammers hit back in the 33rd minute through Demba Ba, but it was the hosts who looked more likely to score another after the break and deservedly made off with all three points.
The result means City consolidate their top-four spot, moving seven points clear of fifth-placed Liverpool.
West Ham, meanwhile, are still bottom of table, three points adrift of safety with three games left to play.
After the visitors had won an early corner and Danny Gabbidon sent a wild effort over from distance, City were soon in the ascendancy and driving forward.
David Silva saw a shot deflect wide and from the resulting corner, Mario Balotelli headed the wrong side of the post.
Silva then teed up Gareth Barry, who sent a shot into Green's arms.
At the other end, Thomas Hitzlsperger sent a free-kick into the box and it fell to James Tomkins, who could not fashion a proper shot.
Almost immediately City were back on the attack, with the lively Adam Johnson cutting inside from the right and hitting a low drive narrowly wide.
A minute later the hosts were in front as the Hammers failed to deal with Aleksandar Kolarov's corner and the ball came out to De Jong, who fired it into the corner from outside the area.
It took another five minutes for City to double their lead, Zabaleta playing a neat one-two with Silva and sending the ball across Green towards goal.
Jacobsen rushed in to try to make a clearance but could only fire it into the roof of his own net.
West Ham were looking bruised and their captain Matthew Upson - who had been involved in a collision with Balotelli - had to come off in the 26th minute, Manuel Da Costa the man coming on in his place.
They had a great chance to pull a goal back just after the half hour mark, though, as Robbie Keane found himself through one-on-one against Joe Hart.
The Irishman failed to make the most of the opportunity as Hart got down to save, but moments later the visitors did make it 2-1 through Ba.
Hitzlsperger's cross into the box appeared to be handled by Joleon Lescott, but the ball fell straight to Ba, who dispatched it past Hart.
West Ham looked to keep up the pressure but City continued to create chances, with Balotelli miscuing an acrobatic attempt and Johnson having the final shot of the first half, which Green collected.
Despite De Jong having to be substituted for James Milner at the break, City made a bright start to the second period and Balotelli crashed a shot against the bar 10 minutes in, Yaya Toure hitting the rebound at Green.
West Ham went close when Da Costa brought a save out of Hart with a flicked header from a corner, but soon after City wasted a glorious chance to restore their two goal advantage.
Having been put clean through by Toure, Silva danced around Green and squared to Balotelli, who had the goal at his mercy but saw his effort blocked on the line by James Tomkins.
Hammers boss Avram Grant then refreshed his forward line by replacing Keane with Carlton Cole.
Opposite number Roberto Mancini did likewise by bringing on Edin Dzeko in place of Barry and City had another good chance moments later, only for Silva to opt to pass when he might have shot.
Grant threw on Victor Obinna for Luis Boa Morte before Ba struck wide, but back came City, Dzeko unleashing an attempt that bounced off Green.
The goalkeeper then tipped a deflected Silva shot over the bar before Balotelli was taken off for Patrick Vieira.
Silva and Dzeko had further late attempts but City had done enough as referee Howard Webb confirmed their victory at the final whistle.