(CNN) -- Holders Bayern Munich are through to the quarterfinals of the German Cup after a thrilling 6-3 victory at nine-man Stuttgart.
The Bavarian giants had beaten the same opponents 5-3 at the weekend, but they went one goal better on Wednesday night thanks to three late strikes.
Andreas Ottl and Mario Gomez gave the visitors a two-goal lead in the first eight minutes, but the home side fought back to level 2-2 at the interval with a double from Pavel Pogrebnyak.
A frantic second 45 minutes saw Miroslav Klose put Bayern back into the lead before Stuttgart had Dutch defender Khalid Boulahrouz sent off for a second yellow-card offense.
Remarkably Stuttgart then missed a penalty before Mattieu Delpierre leveled matters with 13 minutes remaining.
However, the man advantage began to tell, and late goals from Thomas Muller and a second from Klose put Bayern in control.
Delpierre was then shown his marching orders before an injury-time goal from Franck Ribery put the gloss on an extraordinary match.
Meanwhile, on a night of shock results, 2009 Bundesliga champions Wolfsburg were beaten 3-1 at home by second division side Energie Cottbus.
The visitors scored all their goals in a one-sided first half with Nils Peterson netting twice and Shao Jiayi adding a third.
Wolfsburg stemmed the tide after the break and in-demand striker Edin Dzeko pulled a goal back.
However, Cottbus held on for a deserved win as Wolfsburg made it eight matches without a victory to increase the pressure on under-fire coach Steve McClaren.
Elsewhere, Bundesliga strugglers Cologne were also dumped out by a second division club, with Duisburg claiming a 2-1 victory.
Stefan Maierhofer put the visitors ahead in just the second minute and Julian Koch doubled their lead.
Simon Terodde pulled a late goal back for the home side, but it is Duisburg who go into the hat for the last eight of the competition.
And Eintracht Frankfurt made it three Bundesliga sides to lose to lower division opposition as Alemannia Aachen won 5-3 in a penalty shoot-out after the match finished 1-1 after extra time.