Despite getting into promising positions in the first 45 minutes, Liverpool found themselves 1-0 behind at half time after an Ollie Watkins strike, with Roberto Firmino seeing a goal controversially ruled out for offside by VAR.
Liverpool forced themselves level at the start of the second half through Mohamed Salah and it took them until added-time to complete the comeback as Trent Alexander-Arnold finished excellently from the edge of the box to give the Reds a 2-1 win.
The result sees the Reds end their eight-game winless run at Anfield and temporarily move into the top four on 52 points, with their rivals all set to play later this weekend.
Jurgen Klopp made two changes from midweek as Naby Keita and Sadio Mane made way for James Milner and Roberto Firmino in the starting eleven.
Despite the visitors having a couple of early set pieces, it was Liverpool that fared better in the opening 20 minutes as they threatened between the lines through Firmino and fellow forward Diogo Jota.
Mohamed Salah looked dangerous down the right and had two early chances, first forcing Emi Martinez into a save from a driven shot just outside the box before shooting wide of the post from close range.
Alisson made a solid save down to his right from Ezri Konsa's header, before Douglas Luiz was forced to seek treatment for an injury for almost five minutes, ending the Reds' push to build momentum against their opponents.
A pull-back by Firmino evaded the onrushing Gini Wijnaldum but met by Salah, who fired off-target once again as another chance went at a first open goal at Anfield this year went begging for the Reds.
Liverpool looked far more threatening than they have at home in recent months, with the visitors unable to get the ball or put together a meaningful string of passes.
The Reds had plenty of chances but they were punished for their lack of clinical finishing as Ollie Watkins made no mistake with an effort from the edge of the box, with Alisson struggling to get down in time and allowing the ball under his grasp to give the hosts the lead.
Liverpool thought they had dragged themselves level just before the break as Firmino finished from close-range, but VAR controversially ruled the goal out for a Jota offside in the build-up.
The Reds picked up where they left off in the second half and the Reds finally found their elusive open-play Anfield goal as Andy Robertson's strike was palmed away by Martinez into the path of Salah, who tucked the ball home to make it 1-1.
Liverpool backed themselves to get themselves ahead but a lack of intensity at the back saw Trézéguet nearly make it 2-1 to the Villans, but the Egyptian's effort hit the inside of the far post and stayed out.
With a little over 20 minutes left, Wijnaldum made way for Thiago in midfield as Klopp looked to reinvigorate his side after they seemed to have entered somewhat of a lull.
Sadio Mane was also introduced a few minutes later, but instead of a midfielder coming off, the boss chose to withdraw Firmino in a like-for-like change, with Mane going through the middle either side of Jota and Salah.
The move paid off as the Reds finally built momentum in the final minutes and clinched a last-ditch winner, with Alexander-Arnold at the edge of the box striking the ball past Martinez brilliantly to respond to his critics and make it 2-1.
Mane could have put the cherry on the top with the final kick of the game after being played through on goal, but the Senegalese's shot across the keeper was comfortably saved.
The result sees Liverpool move into the top four ahead of West Ham, Chelsea and Tottenham, with their rivals all in action later this weekend. Next up, a big battle against Real at Anfield in midweek...
Liverpool XI: Alisson, Alexander-Arnold, Phillips, Kabak, Robertson, Fabinho, Wijnaldum, Milner, Firmino, Salah, Jota.
MOTM: Trent Alexander-Arnold
Next Fixture: Real Madrid (H) - 14 Apr, 20:00 BST