The top-of-the-table showdown was played at a frantic pace from start to finish as champions City faced the prospect of falling as much as 10 points adrift of the previously unbeaten league leaders, who had won their last nine top-flight outings heading into tonight's match.
However, Leroy Sane produced a pinpoint finish with less than 20 minutes remaining to hand City a crucial three points in the title race as they moved back into second place above Tottenham Hotspur.
Both managers made interesting team selections with Pep Guardiola playing Aymeric Laporte in an unfamiliar left-back role, while Jurgen Klopp reverted to a 4-3-3 formation for the first time in the league since the reverse fixture on October 7.
The game got off to a predictably furious start, with the raucous atmosphere inside the Etihad Stadium mirroring the frenetic pace on the pitch.
Clear chances were at a premium until the 18th minute, though, when Liverpool came within a whisker of breaking the deadlock in a remarkable sequence of events.
John Stones then blasted his clearance against his own goalkeeper before recovering to hook it off the line, somehow evading Salah's follow-up as the ball went bouncing under the foot of Liverpool's top scorer.
The goal decision system showed that the ball was just 11 millimetres away from crossing the line and giving Liverpool the lead, but the visitors were left wondering just how they had not opened the scoring after slicing the City defence open for the first time.
It took the hosts until just before the half-hour mark to create something resembling a chance of their own when Raheem Sterling latched on to a pass down the right channel before cutting inside and teeing up David Silva, but the Spaniard saw his unconvincing effort blocked by Virgil van Dijk.
City were fortunate not to go down to 10 men shortly afterwards when Vincent Kompany escaped with a yellow card for a lunging challenge on Salah, who was almost able to pick off a misplaced pass from Stones.
The telling moment of the first half arrived after five minutes when Aguero provided the touch of quality City had been searching for, bringing up his 250th league goal in explosive fashion by lashing a left-footed half-volley past Alisson Becker and into the roof of the net from the tightest angle.
The goal also saw Aguero become the first player to score in seven successive home Premier League games against a single opponent, and it sent Guardiola's side into the interval with the lead following a first half in which little separated the two sides.
Sterling saw a penalty shout turned down and the tireless Fernandinho fired an effort well off target in the opening stages of the second half, but Liverpool began to grow back into the game as they went in search of the equaliser.
Trent Alexander-Arnold fired one effort against the stanchion from the edge of the area before Firmino saw another shot blocked by a throng of defenders on the line, with Ederson having come for a free kick but been beaten to the ball by his own man.
Danilo had also come close at the other end having been allowed room to shoot, but the Brazilian could not prevent his compatriot Firmino from levelling things up shortly after the hour mark.
Alexander-Arnold floated an inch-perfect cross over the head of Danilo for Andrew Robertson, who in turn played it back across the face of goal for Firmino to send a simple stooping header into the empty net.
Parity lasted just eight minutes, though, as City - who knew that their need for victory was far greater than Liverpool's - came storming back to regain the lead in the 72nd minute.
Sterling was the creator against his former club as he darted inside before finding Sane, but the German still had plenty to do and his pinpoint finish across goal struck the inside of the post before going in.
Liverpool's subsequent pressure led to a scramble inside the City area with nine minutes remaining, but once the champions had escaped they launched a devastating counter-attack which ended with Alisson preventing Aguero from taking the ball round him when one on one.
It was the Brazilian in the opposite goal who was called into action moments later when Salah got the wrong side of Laporte before seeing his shot tipped wide by a smart Ederson save - a moment which left Guardiola fuming on the sidelines after he felt Fernandinho was fouled in the buildup.
Another scramble followed from the resulting corner, but it was Man City who created the biggest chances to add to the scoring in the closing stages, with Bernardo Silva being denied by Alisson and Sterling somehow firing the follow-up effort off target with the goal gaping.
The former Liverpool man was not made to rue that miss, though, as City held out for a vital victory which breathes new life into their title defence, having become the first team this season to score two goals past Klopp's side in a Premier League game.
Liverpool, meanwhile, see their nine-game winning run and 21-match unbeaten Premier League streak come to an end, but they remain top of the table by four points and will be hoping to respond when they are next in league action against Brighton & Hove Albion later this month.
MAN CITY (4-3-3): Ederson; Danilo, Stones, Kompany (Otamendi 88'), Laporte (Walker 86'); Bernardo, Fernandinho, Silva (Gundogan 65'); Sterling, Aguero, Sane
LIVERPOOL STARTING XI: Alisson; Alexander-Arnold, Lovren, Van Dijk, Robertson; Henderson, Milner (Fabinho 57'), Wijnaldum (Sturridge 86'); Salah, Firmino, Mane (Shaqiri 77')