Newcastle 2-3 Liverpool
Jurgen Klopp's side took the lead early on as an unmarked Virgil van Dijk powerfully headed home from Trent Alexander-Arnold's corner.
Rafa Benitez's side equalised just seven minutes later as Christian Atsu slammed home from close-range.
Javier Manquillo's cross reached Matt Ritchie, whose wayward shot landed at the feet of Salomon Rondon. Alexander-Arnold cleared his shot off the line, however Atsu was there to finish the rebound.
Liverpool took the lead again just eight minutes later, moments after Newcastle almost scored themselves to make it 2-1.
Daniel Sturridge's back-heel pass found Alexander-Arnold, who registered his second assist of the night by crossing in for Mohamed Salah to convert from close-range.
Newcastle's attacking threat was clear to see and they equalised early in the second-half as Rondon finished superbly to make it 2-2 after the ball fell to him in the box from a corner.
Liverpool suffered a huge blow with 20 minutes to go as Salah collided with goalkeeper Martin Dubravka and appeared to be in agony, lying motionless on the ground. The Egyptian was stretchered off with Divock Origi coming on in his place.
The Reds, without Salah and the injured Roberto Firmino, needed a goal to keep their title hopes realistic with pressure building on the side with each minute ticking away.
They proved their mettle with just four minutes to go as Origi was the saviour once again. The Belgian glanced home from substitute Xherdan Shaqiri's cross to score perhaps Liverpool's most crucial goal this season.
Liverpool saw out eight minutes of added time to win a vital three points, ensuring the Premier League title will be decided between them and Manchester City on the last day of the season.
This video is no longer available.