Liverpool 1-2 Man City
Nicolas Anelka struck in the third minute of injury-time to give Manchester City victory against Liverpool at Anfield.
Milan Baros gave Liverpool the lead with a well-struck volley but former Anfield striker Anelka equalised from the penalty spot.
Anelka then grabbed a second in dramatic fashion against a nervous home side late on.
But Liverpool's Champions League hopes are still alive because of Chelsea's defeat by West Ham.
Liverpool now need a win at Chelsea in their final game to decide which of the two qualifies for Europe's elite tournament.
58 mins: Baros powers Liverpool ahead
74: Anelka scores from the spot
92: Anelka grabs a City winner
The associations between City and Liverpool saw the match start with a strong competitive edge.
City strikers Robbie Fowler and Anelka were back at Anfield along with former Liverpool favourite and City boss Kevin Keegan.
The visitors seemed fortunate not to concede a penalty after 11 minutes when Baros looked to have been pulled down as he tried to break free of Sylvain Distin and David Sommeil.
Baros went down nine minutes later after clashing with Joey Barton only to see a free-kick awarded to City.
Liverpool keeper Jerzy Dudek tipped over Niclas Jensen's attempted cross for City's best chance of the first half.
The home team could not find a way through City's well-organised and disciplined defensive lines and were themselves limited to two efforts from long range free-kicks.
Anelka equalises from the spot for City
Steven Gerrard and Dietmar Hamann were both denied by the quick reflexes of City keeper Peter Schmeichel before the interval.
Anelka almost gave City the lead shortly after the break but put an angled shot into the side-netting.
City were the more likely to score but it was Liverpool who took the lead after 58 minutes through Czech Republic forward Baros.
Diouf provided the right-wing cross and Baros smacked in a near-post volley from eight yards past Schmeichel.
City were incensed at a Hamann challenge on Fowler in the build-up to the goal but referee Neale Barry waved away their protests.
A Diouf effort was excellently saved by Schmeichel minutes later before the big Danish keeper denied Baros from close range.
But the lead was short-lived for the home side after Djimi Traore brought down Anelka.
The Frenchman picked himself up to confidently convert the spot-kick in front of the Kop.
The striker whose loan deal at Liverpool was not turned into a permanent move last summer put away a volley in the 93rd minute to City's winner.
Liverpool: Dudek, Carragher, Traore, Hyypia, Riise,
Diouf (Heskey 78), Hamann (Cheyrou 78), Gerrard, Murphy, Owen, Baros. Subs not used: Arphexad, Diao, Biscan.
Booked: Hamann, Heskey.
Man City: Schmeichel, Dunne, Sommeil, Distin, Wright-Phillips, Barton, Benarbia, Horlock, Jensen, Fowler, Anelka. Subs not used: Nash, Macken, Jihai, Bischoff, Belmadi.
Booked: Horlock, Dunne.
Referee: N Barry (N Lincolnshire).