Firmino came off the bench to fire home a minute from time in his final appearance for the Reds at Anfield.
Jacob Ramsey had earlier put Villa in front after Ollie Watkins missed a penalty in front of the Kop, before Cody Gakpo controversially saw a leveller ruled out by VAR.
The draw means Villa are guaranteed European football if they beat Brighton in their final match.
That game will have to go some to match the chaos of this occasion. Martinez, untroubled in an opening half the visitors controlled, collapsed to the turf in near exhaustion at the final whistle after a second period which seemed to be played almost exclusively in the visitors’ half. Martinez was one of three Villa players booked for time-wasting.
Gakpo thought he brought the hosts level 10 minutes into the second half when he converted from close range following a scramble but referee John Brooks, after consulting the monitor, ruled Ezri Konsa had not intentionally played the ball earlier in the move, meaning Virgil van Dijk had been in an offside position earlier in the move.
Villa stood firm against opponents who had won their seven previous matches and looked to be on course for a famous win before Firmino delivered something of a fairytale finish to his Anfield career, though the point left the home side’s Champions League hopes hanging by a thread.
The draw does move Villa above Tottenham, beaten 3-1 at home earlier in the day by Brentford. A win at home to a Brighton team who can virtually confirm sixth place by beating Southampton on Sunday will now be enough to secure a European spot for Villa.
Villa’s line-up featured three changes including at both full-back positions, with Matty Cash and Lucas Digne replacing Ashley Young and Alex Moreno.
In midfield, Boubacar Kamara made his first start since April’s win at Chelsea, with Emi Buendia the man to make way.
Buendia’s omission saw John McGinn in a more advanced role and it was the skipper’s first-time ball over the top of the home defence which led to the penalty.
Konate got none of the ball when trying to challenge Watkins and referee John Brooks, the fourth official who Klopp has screamed at to earn his touchline ban, pointed straight to the spot.
Watkins had scored from the spot on his last visit to Merseyside, netting the opener In February’s 2-0 win at Everton. This time however, he placed his penalty a foot wide of Alisson’s left-hand post.
It was a huge chance missed but just five minutes later Villa did go ahead. Luiz swung in a cross to the far post and Ramsey arrived unmarked to send a left-footed finish beyond the keeper and into the bottom corner.
Liverpool looked for a response but it was Villa who would have increased their lead but for Alisson, who flung out an arm to block Ramsey’s shot after a training ground free-kick routine had seen the scorer run on to Luiz’s pass.
The biggest alarm for Villa came when they were caught deep in possession and Luiz Diaz angled a header just wide of the post. Yet Emi Martinez ended the half having not been troubled.
Liverpool’s first effort on target was a curling Mo Salah shot straight into the keeper’s arms early in the second half.
With their second, the hosts thought they had levelled when Gakpo eventually forced home after Mings had brilliantly blocked Konate’s goalbound effort on the line.
But after a VAR check, which eventually saw referee Brooks check the monitor, van Dijk was ruled to have been in an offside position earlier in the move.
Things were getting chaotic. Moreno, off the bench to replace Digne, was injured stretching to deny van Dijk a chance, with Young then becoming Villa’s third left-back of the afternoon.
Alexander-Arnold was then a little fortunate after kicking the ball away immediately after pulling down Ramsey. Referee Brooks, who already had his card out for the first offence, ignored the second. Noise from the Kop then approached a cresendo as Alexander-Arnold raced to meet a loose ball but his shot was straight at Martinez.
The latter was booked for time-wasting with 13 minutes remaining as Villa continued to try and run out the clock. Diogo Jota, on as a substitute, caused a brief moment of alarm when he raced in on the left-hand side of the box but slipped at the vital moment.
Villa were starting to look comfortable but with a minute of the 90 to go, Firmino brought the home side level, diving in behind Mings to stab home Salah’s cross.
Liverpool’s tails were up but Villa held firm through 10 minutes of stoppage time.
22 MISSED PENALTY Ollie Watkins squanders a golden chance to put Villa ahead when he misses from the spot, having been brought down by Ibrahima Konate.
27 GOAL Villa do now lead. Douglas Luiz finds an unmarked Jacob Ramsey at the far post and he fires past Alisson.
55 VAR Liverpool think they have equalised when Cody Gakpo finally forces home but the goal is ruled out following for offside following a lengthy check.
89 GOAL Roberto Firmino levels, stabbing home Mo Salah’s cross.
Liverpool (4-3-3): Alisson, Alexander-Arnold, Konate, van Dijk, Robertson (Tsimikas 73), Henderson (Milner 73), Fabinho (Elliott 81), Jones (Jota 63), Salah, Gakpo, Diaz (Jota 73) Subs not used: Gomez, Firmino, Carvalho, Matip, Kelleher (gk).
Villa (4-4-2): Martinez, Cash, Konsa, Mings, Digne (Moreno 53 (Buendia, 65), McGinn, Kamara, Luiz (Dendoncker 87), Ramsey, Bailey (Young 53), Watkins (Duran 87_ Subs not used: Traore, Sinisalo (gk), Olsen (gk).