The Eastlands club were unlucky not to have scored more as they peppered Robert Green's goal all day but managed to come away with the victory they so desired to go well clear of fifth-placed Liverpool with a game in hand and they are now on the verge of next season's Champions League competition.
But the visitors hit back just after the half-hour mark when Demba Ba stabbed home from close range to give Avram Grant's men hope.
Both teams went on the attack in the second half but there was no addition to the score as City made it seven wins from their last eight at home whilst West Ham lost their fifth on the trot and are now perilously close to playing Championship football next season.
Man City begun very brightly by making all the attacking running early and it paid off when they opened the scoring in the 10th minute. GOALAleksandar Kolarov's corner from the left was only knocked as far as midfielder Nigel de Jong who had time and space to pick his spot and send a fierce, curling shot through a crowd of players and past Hammers keeper Robert Green from about 30 yards for his first goal for the club.
GOAL Less than five minutes later, City were two ahead when Pablo Zabaleta made a clever run into the area before being picked out by David Silva's pass, controlling with his chest and then getting a shot off from a tight angle. As the ball was being directed into the goal, Hammers defender Lars Jacobsen helped it on his way as he attempted to clear it from danger as the home side set themselves up for a potentially big day.
To make matters worse, West Ham lost skipper Matthew Upson to a leg injury in the 26th minute just as Yaya Toure started to work his way into the game with a neat piece of play from midfield but his final shot did not hit the target as Green could breathe easy watching the ball fly wide.
The Hammers woke up after that moment and had a golden opportunity to peg one back just after the half-hour mark when Robbie Keane was played in but the Tottenham loanee decided to try and dink over an advancing Joe Hart when perhaps he should have gone around him, the end result being a save by the City keeper.
GOAL That attacking move inspired the visitors who managed to give themselves some hope when Demba Ba fired home from close range. Keane flicked on a cross with the ball falling to Ba, who took a touch which hit the arm of Joleon Lescott before dropping back into the path of the Senegal international and he stabbed home to make it 2-1 in the 33rd minute.
There were no real chances to speak of in the remaining 10 or so minutes of the first half as Avram Grant and his men would have been delighted to be back in the game at the whistle.
City looked like they had returned to the ways of earlier in the game as they showed their attacking intent after the break and came agonisingly close to a third when Silva found Mario Balotelli on the edge of the area but the Italian's well-weighted shot over Green hit the crossbar, deflecting to an unmarked Toure whose attempt was thwarted by the Hammers gloveman who did well to get back.
The City fans were starting to get a bit anxious around the hour-mark, especially when Manuel da Costa's header from Thomas Hitzlsperger's corner was kept out by Hart moments before Silva was played on-side into acres of space down the other end but Green did well to carrel him, forcing the Spaniard to play it wider to Balotelli whose shot was kept out by scrambling Hammers defenders on the goal line.
Things really picked up with about 25 minutes left as both sides chased a goal with City looking the more likely to add to their tally. That almost occurred when Edin Dzeko unleashed from way outside the area with Green unable to hold the shot but thankfully, from a Hammers viewpoint, there was nobody waiting to tap it home.
Green was being kept very busy by the City forwards in the dying stages but the home side could not grab a third as the Hammers are now resigned to the foot of the table with three games left.
Man City Joe Hart (gk) - Pablo Zabaleta, Vincent Kompany, Joleon Lescott, Aleksandar Kolarov - Adam Johnson, Gareth Barry (Dzeko 74'), Nigel de Jong (Milner 46'), Yaya Toure, David Silva - Mario Balotelli (Vieira 86')
West Ham Robert Green (gk) - Lars Jacobsen, James Tomkins, Matthew Upson (da Costa 26'), Danny Gabbidon - Freddie Sears, Jonathan Spector, Thomas Hitzlsperger, Luis Boa Morte (Obinna 79') - Robbie Keane (Cole 66'), Demba Ba