Additional goals to defender Joel Matip and Alex Oxlade-Chamberlain, who started in his first Premier League game for Liverpool since joining the club from Arsenal in August, gave Liverpool their second-largest win of the season.
A solitary goal to Argentine midfielder Manuel Lanzini was the only consilation West Ham could manage.
The result leaves Slaven Bilic's side one point outside of the relegation zone, while Liverpool sit in sixth position, sandwiched between Arsenal and Burnley on 19 points.
Elsewhere, Premier League new boys Brighton and Huddersfield moved into the top half of the table after recording 1-0 home wins.
Brighton extended its unbeaten run to four games by defeating Swansea 1-0 with Glenn Murray scoring for a third consecutive game.
Huddersfield held on for a 1-0 win over West Bromwich Albion despite playing the final third of the game with 10 men.
Christopher Schindler was sent off after receiving a second yellow card, but Rajiv van La Parra's first-half strike was enough.
The other promoted team, Newcastle, conceded a last-minute goal to Bournemouth in a 1-0 loss.
Newcastle failed to win for the fifth time in six matches.
However, the team coached by Rafa Benitez still holds a six-point cushion above the relegation zone.
With Brighton and Huddersfield both in the top half of the standings, there is an opportunity for all three promoted clubs to avoid relegation for only the third time in Premier League history.
Earlier in the day, Leicester stayed unbeaten under manager Claude Puel while twice wasting the lead in a 2-2 draw with Stoke.