An action-packed encounter at Anfield was settled when Sadio Mane netted in the 81st minute to restore the Reds' 22-point advantage at the top of the table.
Here are five talking points from the match...
Reds fight back
When Pablo Fornals put West Ham 2-1 up in the second period, Liverpool's response was perfect.
Jürgen Klopp's men merely hammered the door down searching for a route back into the game as they looked to avoid their first home defeat in the league since April 2017.
Mohamed Salah's 68th-minute finish levelled proceedings before Mane was in position to convert from close range to claim victory for the league leaders.
It was a satisfying, albeit nervy, result for Klopp and his side that leaves them four wins away from winning the title.
Incredible records
The victory brought up some truly incredible numbers for this Liverpool team.
They have won each of their last 21 Premier League fixtures at Anfield to equal the top-flight record set by Liverpool in 1972 under Bill Shankly.
Manchester City's feat of 18 consecutive league victories was also matched, leaving the Reds on the brink of history as they travel to Watford on Saturday evening.
Final-third production from full-back
Trent Alexander-Arnold continued to do what he does best.
By claiming two assists against the Hammers, the 21-year-old has now equalled his own record for most assists by a defender in a single Premier League season (12).
He also became the third-youngest player, behind Cesc Fabregas and Wayne Rooney, to rack up 25 assists in the competition.
"I’m doing whatever I can to help the team and that’s how we all think," the No.66 said post-match.
Andy Robertson, too, delivered in the same sense. His driving run and cut-back from near the left touchline found Salah for the goal that made it 2-2.
Ox's impressive cameo
It's a sign of just how good Alex Oxlade-Chamberlain's display off the bench was that he finished second to Alexander-Arnold in the club's Man of the Match poll.
Replacing Naby Keita in minute 57 and not long after West Ham went ahead, Oxlade-Chamberlain brought about the 'direction' Liverpool needed, according to his manager.
Oxlade-Chamberlain's touches against West Ham
That equated to 32 touches of the ball for the No.15, one interception and two key passes played.
"That helped," Klopp stated during his post-match press conference.
A decisive intervention
Alisson Becker was once again on hand to make sure of another three points claimed by Liverpool.
With the Reds 3-2 up, West Ham launched a late attack that saw substitute Jarrod Bowen burst through on goal.
Bowen was alone in the penalty area and just had Alisson to beat as he attempted to dink the ball over the Brazilian goalkeeper and earn West Ham a much-needed point.
But Alisson displayed nerves of steel to not fall to ground too early, making himself big enough to keep out Bowen's effort with his head.
"Match-winning save," goalkeeping coach John Achterberg commented on Twitter.
Free video: Alisson pulls off brilliant late save against West Ham