David Moyes came to Anfield without his talisman Declan Rice, while the likes of Mohamed Salah, Virgil van Dijk, Sadio Mane and Luis Diaz were recalled.
Salah nearly netted the opener three minutes in when he caught the Hammers defence napping to go one-on-one with Lukasz Fabianski, who pulled off the save.
The Hammers were not outplayed in the early stages and had a couple sights at goal of their own, with Michail Antonio forcing two saves out of Alission Becker.
However, it was Jurgen Klopp's men who took the lead after 28 minutes when Sadio Mane flicked Trent Alexander-Arnold's shot into the back of the net, with VAR approving the strike.
Moyes' charges had the chance to get themselves back on level terms before the break through Pablo Fornals, who was left one-on-one with Alisson but Alexander-Arnold managed to get back clear the effort off the line.
The visitors' hopes of a comeback suffered a blow when Jarrod Bowen was forced off with an injury and replaced by Said Benrahma on 53 minutes.
West Ham continued to push despite losing their star forward, as Manuel Lanzini fired horribly over the crossbar in the six-yard area after getting on the end of Fornals' cross.
With time running out in the second half, Klopp opted to withdraw Salah for the final 11 minutes as Diogo Jota made his way onto the pitch.
The decision to withdraw Salah did not backfire as the Reds defence managed to see off a late push from the visitors and secured victory to move within three points of Man City.