Andrew Robertson equalised with four minutes left before Senegal winger Mane's stoppage-time goal gave Liverpool their 10th win from 11 league games.
The Reds, chasing their first English title since 1990, are six points ahead of second placed City.
Pep Guardiola's champions fell behind to James Ward-Prowse's early goal at the Etihad Stadium.
But Sergio Aguero levelled for City with 20 minutes left and Kyle Walker snatched the winner in the 86th minute to keep Liverpool in their sights.
Elsewhere, Manchester United slumped a 1-0 loss at Bournemouth and Arsenal were held to a disappointing 1-1 draw by Wolves, but all the focus was on the drama at the top of the table.
Southampton had lost 3-1 at City in the League Cup on Tuesday, a result that came just days after their 9-0 league thrashing by Leicester.
Sheffield United are up to sixth after a 3-0 victory against Burnley and Brighton beat Norwich 2-0.