With this victory, West Ham climbed to 15th place, surpassing Everton and matching the points tally of Tottenham Hotspur and Manchester United. Meanwhile, Leicester suffered their fourth consecutive league defeat, leaving them in 19th place, five points adrift of safety.
Sixth-placed West Ham looked set for a damaging defeat at Amex Stadium after Danny Welbeck's 50th Premier League goal broke the deadlock only three minutes earlier.
Jesse Lingard inspired a 3-2 win over Wolverhampton as the midfielder ran from the halfway line to score one goal and also set up another for substitute Jarrod Bowen
Kelechi Iheanacho scored a hat-trick to help Leicester City thrash bottom side Sheffield United 5-0 to compound the Blades' misery one day after the club confirmed the departure of coach Chris Wilder, Xinhua news reports.
That game opens a weekend which also offers a fascinating game between Chelsea and Manchester United, while Leicester City face Arsenal and Liverpool will have hopes of returning to winning