City were made to work by an under-manned Hammers to edge one point clear of Arsenal in the title race, with a game in hand still to come.
The visitors were missing England international Declan Rice, Tomas Soucek and Nayef Aguerd through illness, while injuries meant David Moyes could only name five outfield substitutes.
But Moyes’ men held out for 50 minutes before succumbing at the Etihad to remain rooted in a relegation battle.
Nathan Ake was the unlikely figure to break the deadlock as the Dutch defender rose highest to power home Riyad Mahrez’s free-kick.
But there was no surprise over the scorer of City’s second as Haaland raced onto Jack Grealish’s pass and deftly dinked the ball over the advancing Lukasz Fabianski.
The Norwegian moved past Alan Shearer and Andy Cole’s mark of 34 set for Blackburn and Newcastle respectively in the 1990s.
Haaland was given a guard of honour by his teammates as he left the pitch after full-time.
However, he will still fall someway short of the all-time scoring record for a season in the English top flight of 60 set by Everton’s Dixie Dean in 1927/28.
Phil Foden came off the bench to add the final flourish as his sweetly-struck volley deflected off Emerson Palmieri to leave Fabianski wrong-footed five minutes from time.
City’s 13th consecutive home win in 2023 edges Pep Guardiola’s men ever closer to a fifth Premier League title in six seasons.
The champions need just four wins from their remaining five games to ensure Arsenal are denied their first title in 19 years.
Defeat leaves West Ham still four points above the relegation zone with four games to play.
At Anfield, Liverpool refused to give up the fight for a top-four finish by keeping the pressure on Newcastle and Manchester United for the final two places in next season’s Champions League behind City and Arsenal.
Jurgen Klopp’s men have now won five league consecutive league games for the first time this season.
Mohamed Salah’s 29th goal of the season was the difference between the sides as the Egyptian shrugged off his recent struggles from the penalty spot to convert after Darwin Nunez had been fouled by Issa Diop six minutes before half-time.
Liverpool close to within four points of fourth-placed Manchester United, who have two games in hand.