The Hammers' academy products net for the visitors as Reds move to within four points of the top four with late comeback after Steven Gerrard's own goal put them behind
Glen Johnson scored a stunning opener against his old club to put the visitors ahead in the 11th minute before the Hammers hit back to take the lead at half-time through Mark Noble’s penalty and a Steven Gerrard own-goal.
But Liverpool stormed back late on to turn the game, another former Hammer, Joe Cole, scoring in the 76th minute before Jonjo Shelvey’s glancing effort looped in off James Collins 11 minutes from time to give the visitors all three points.
The result moves the Reds up to 10th in the Premier League, level with West Ham and just four points behind local rivals Everton in fourth place.
With talismanic striker Luis Suarez suspended, the limited attacking options available to Brendan Rodgers were highlighted as the Liverpool manager played Romford-born Shelvey as a ‘false nine’ at the club where he spent three years as a youngster from the age of 12.
The atmosphere around Upton Park ahead of kick-off was optimistic off the back of a successful week in which the Hammers beat Chelsea and were named as the preferred bidders for the Olympic Stadium.
It was an east end boy who silenced the crowd in the crowd with the opener in the 11th minute. After collecting a Gerrard’s pass on the right touchline, Johnson cut inside and launched a stunning strike into the top corner from 20 yards as the West Ham defence backed off. The full-back has scored in his last three games against his former club but refused to celebrate as team-mates mobbed him.
Liverpool, much like Chelsea eight days earlier, dominated the first quarter of the game and could have doubled the lead, Raheem Sterling coming closest when he swept just wide from 12 yards after more good work from Johnson.
In the 36th minute, the hosts drew level when referee Lee Probert awarded a penalty as Joe Allen handled Mohamed Diame's volley from the edge of the box. The visitors protested against the decision in vain before Noble stepped up to calmly slot the kick low into the left corner.
Kevin Nolan headed just over the bar from close range but the Hammers took the lead two minutes before the break in comical circumstances. Matt Jarvis swung in a vicious cross from the right and, as several player strained to get a touch, Gerrard could only head the ball into his own net.
The pace of the game dropped immediately after the break as West Ham looked to consolidate their lead - but Liverpool came storming back in the final quarter of the match.
In the 67th minute, Sterling forced Hammers goalkeeper Jussi Jaaskelainen into a fingertip save with a powerful left-footed shot from the edge of the penalty area.
The day was soured for West Ham as the excellent Diame was taken off the field on a stretcher 17 minutes from time after picking up what appeared to be a serious hamstring injury.
And it got even worse as Sterling slipped in Cole with a delightful pass, and the forgotten man kept his cool to sweep home a lovely finish into the far corner with his weaker left foot.
Then three minutes later Shelvey got on substitute Jordan Henderson’s cross, his flicked effort hitting Collins before spinning over Jaaskelainen into the net. A breathless, brilliant victory for the Merseyside club.