Borussia Dortmund coach Jurgen Klopp admitted he was relieved to be "back in the race" for a Champions League last 16 berth after their 3-1 win over Napoli.
Dortmund's 1-0 home defeat to Arsenal three weeks ago had left last season's finalists third in Group F and heading for a group stage exit.
But a Marco Reus penalty and second-half strike by Jakub Blaszczykowski put Dortmund 2-0 up with an hour gone before Lorenzo Insigne pulled one back for Napoli with 20 minutes left.
Substitute Pierre-Emerick Aubameyang came on to grab Dortmund's third, 12 minutes from time, to calm nerves and put Borussia level on nine points with Napoli in the group behind leaders Arsenal.
"Now we're back in the race," said Klopp, whose side broke a three-match losing streak including Saturday's 3-0 drubbing at home to Bayern Munich.
"We couldn't have done more to set things up for the last game.
"We knew that this would be a spectacular match, but I didn't expect to see so many chances and so much excitement on the pitch.
"We wasted a lot of opportunities, but (Napoli goalkeeper) Pepe Reina also made some great saves.
"We worked hard and recorded a highly deserved win, but Napoli were a very tough opponent and it wasn't easy for us."
With the Gunners three points clear, who will qualify from Group F will now be decided by the final round of pool matches when Dortmund travel to Marseille and Napoli host Arsenal in a fortnight.
Dortmund right-back Kevin Grosskreutz admitted the permutations of what Borussia need to progess to the knock-out stages had bothered him during the game.
"After Napoli scored their goal, I asked (Dortmund captain) Sebastian Kehl if the result was still good enough for us," said Grosskreutz.
"Our coach (Klopp) had explained everything the day before, but I didn't fully understand it at the time.
"After we scored to make it 3-1, I knew that was enough.
"We wanted to give our fans and ourselves something to celebrate. We deserved to win."
The victory at Dortmund's Westfalenstadion avenged Borussia's 2-1 defeat at Napoli in September, but their coach Rafael Benitez admitted his side had struggled to cope with the hosts' pressing game.
"Our mentality is to try to win every game against any opponents and I think we played the right way," said the Napoli boss.
"However we were facing one of the best counter-attacking teams in Europe and it was not easy after going down so early in the game."