The visitors started strongly and after Joel Matip's header hit the bar, Coutinho played in Daniel Sturridge who rounded goalkeeper Adrian to score.
West Ham's Andre Ayew twice stabbed the ball against the post just before the break but Liverpool took control in the second half, Coutinho adding a second after Georginio Wijnaldum hit the bar.
Coutinho fired a second from a swift break before Divock Origi completed the scoring with 14 minutes to go from close range.
Liverpool are now four points clear of Arsenal, who have match in hand, and the Reds will seal a top-four place if they win their final match of the season at home to relegated Middlesbrough next Sunday.
West Ham, meanwhile, remain in 12th place.