Second-tier Augsburg beat eight-man Cologne
Bayern Munich, with Franck Ribery starting his first game for four months, scored five times in the second half in a 6-2 win over SpVgg Fuerth, another tier two team, while Schalke 04 beat third division VfL Osnabrueck 1-0 away.
Cologne were quickly in trouble when Michael Thurk gave Augsburg a third-minute lead and a straight red card for Adil Chihi on the half hour for elbowing added to their worries.
There was more trouble when Lukas Podolski, who came on as a substitute on the hour, was dismissed nine minutes later when he was booked for sarcastically applauding the referee and, immediately afterwards, for arguing again.
Petit followed with five minutes left for a second bookable offence before Nando Rafael added a second for Augsburg to send them to the semi-finals for the first time.
Bayern notched their 11th successive win in all competitions, thanks to a dramatic second-half revival in a game in which Fuerth's Sami Allagui scored at both ends.
Thomas Mueller gave Bayern a fifth-minute lead on a frigid night but Christopher Noethe levelled five minutes later after charging down Martin Demichelis's attempted clearance and Allagui headed the underdogs ahead just before the break.
Bayern hit back with three goals in seven minutes either side of the hour.
Arjen Robben equalised from a penalty, then Ribery, whose season has been plagued by injury, curled in the third before setting up Philipp Lahm for the fourth.
In the final 10 minutes, Mueller added a fifth from a Robben pass and Tunisian Allagui headed into his own goal, taking Bayern's tally to 18 in four Cup games this season.
Osnabrueck put up a brave fight against Schalke in the evening's other match before a second-half strike from Kevin Kuranyi sent the first division team through.
Holders Werder Bremen, who beat Hoffenheim on Tuesday, completed the semi-final line-up.