Marvin Emnes fired the visitors in front on Merseyside, before Mario Balotelli stepped off the bench to haul the hosts back into the tie.
The real drama was saved for stoppage-time, though, with Federico Fernandez sent off for Swansea and Dejan Lovren benefitting from some sloppy defending to nod home a dramatic winner.
Dutch winger Emnes, on his first start of the season, opened the scoring on 65 minutes when he watched a looping ball over his shoulder and drilled across Brad Jones.
Brendan Rodgers then turned to the enigmatic Balotelli, and within seven minutes of his introduction he had restored parity as he met a cross from Fabio Borini with a cushioned volley.
A frantic finale was then sparked when Fernandez was given his marching orders for a crunching challenge on Philippe Coutinho and Lovren settled the tie in 95th minute as Gerhard Tremmel got caught under a high free-kick and the Croatian defender diverted the ball into an empty net.
Liverpool – without a goal in their last two games, both of which had also been at Anfield – controlled possession in the first half, but remained unable to make it count whenever they probed.
Captain for the night Jordan Henderson hoisted an early free-kick high over the bar, before Tremmel got behind a low Lucas Leiva drive from the edge of the box.
The lively Coutinho dragged a shot wide having tried his luck from the edge of the area, and his corner was then headed well off-target by Rickie Lambert.
A further Coutinho burst saw the ball move to Henderson and on to Lazar Markovic, who skewed horribly into the stand.
Borini, the forward once at Swansea on loan, got involved as Liverpool looked to step things up, turning nicely away from his marker and curling just wide. Soon after, he seized the ball as the visitors lost possession, drove forward and forced Tremmel into a decent save.
Another man playing against his old team, Jonjo Shelvey, then came to the fore as the Swans suddenly applied some pressure with the half nearing its end.
The England international took one free-kick which was cleared as far as Nathan Dyer, whose shot deflected wide, and moments later, fired another low effort towards goal, bringing a diving save out of Jones.
It was Swansea then showing the greater urgency at the start of the second half, with Bafetimbi Gomis heading a corner in to Jones.
Coutinho had sent another shot at Jones and subsequently miscued at the end of a passing move, shooting over.
But it was the away side now looking more likely to break the deadlock, and they duly did 20 minutes after the interval as Shelvey’s through-ball was helped on by a touch from Neil Taylor to tee up Emnes, who beat Jones nicely with a shot on the swivel.
Emnes soon threatened to score again, seeing his strike deflect into Jones’ arms, but Liverpool then caused panic in the Swansea area as Glen Johnson’s fierce effort was parried by Tremmel and cleared behind. The resulting corner led to a scramble which the Swans survived.
Tremmel dealt with further attempts by Coutinho and Lambert before the latter – whose search for a first Reds goal has now extended to 10 games – was withdrawn for Balotelli.
Within seven minutes the maverick striker had broken his own drought, netting his second Liverpool goal and first in nine matches as he got ahead of Angel Rangel to prod in Borini’s cross from close range.
The late drama did not let up, with Fernandez then seeing red for his sliding tackle on Coutinho – the decision from referee Keith Stroud leaving Swansea boss Garry Monk looking decidedly unamused.
There was also a brief off-the-ball confrontation between Shelvey and Balotelli, before Lovren crashed the ball home from Coutinho’s free-kick.