The Polish forward pulled Xavi Hernandez’s side level at 2-2 in the 82nd minute and then again at 3-3 in stoppage time, after Robin Gosens put the Italians ahead with one minute remaining.
Barcelona’s Champions League fate is no longer in their own hands though and they still face a second consecutive group stage elimination if Inter Milan win at home against eliminated Viktoria Plzen on October 26.
Being on the verge of another early knock-out is a bitter blow for the Catalans, who hoped a summer signing spree including Lewandowski from Bayern Munich could restore their position among Europe’s elite.
The hosts made the early running but Lautaro Martinez flashed a warning shot into the side-netting on the counter attack, with Inter sitting deep but ready to spring forward.
Lewandowski, in search of his first goal in three games, had a header cleared off the line by Henrikh Mkhitaryan and Raphinha’s shot was deflected inches over the crossbar.
At the other end Edin Dzeko hit the crossbar, with the ball bouncing down but not crossing the goal-line, with Barcelona gratefully scrambling the ball to safety.
Andre Onana denied Ousmane Dembele and Pedri, while his Barcelona counterpart Marc-Andre ter Stegen produced a solid stop to keep out Denzel Dumfries on the break.
Raphinha was frustrated after skewing a volley wide but his work-rate proved crucial when Barcelona broke the deadlock. The Brazilian winger chased a ball down in the corner and fed Sergi Roberto, who cut the ball across for Dembele to blast home from close range.
It was his first goal in the Champions League for nearly two years, and another milestone in his renaissance under Xavi, arguably Barcelona’s best player since the coach arrived at Camp Nou in November 2021. Dembele embraced his coach on the side of pitch after an emphatic celebration.
Inter stewed on the goal at half-time and quickly produced one of their own, netting in the 50th minute after Gerard Pique played Nicolo Barella onside and the Italian rifled home.
The Inter midfielder snuck behind Pique, who waved a cross past him, towards Ter Stegen, not reading Barella’s movement.
The defender, 35, was starting his first Champions League game of the season, with Barcelona paying the price for Jules Kounde, Ronald Araujo and Andreas Christensen’s injuries.
And it was another of the team’s veterans who gave the ball away for Inter’s second goal, with Sergio Busquets conceding possession with a stray pass. Hakan Calhanoglu found Martinez, and the Argentine striker left defender Eric Garcia for dead and slammed home via the post.
Lewandowski drilled past Onana at the other end but was clearly offside, as Barcelona desperation grew, with the Polish forward sending a diving header wide.
Eventually Lewandowski got his goal with a deflected strike at the second attempt after substitute Alejandro Balde found him in the area.
Gosens thought he had handed Inter qualification and eliminated Barca when he struck late on, but Lewandowski had other ideas. His goal saved Barcelona from certain elimination, but their future in the competition still hangs by a fraying thread.