The Bavarians, who have only won one of their last three league games to drop off the top spot, took a deserved lead with winger Franck Ribery cutting into the box to connect with a Thomas Muller pass.
Toni Kroos had earlier rattled the bar with a 20-metre drive.
Former Stuttgart striker Mario Gomez pounced seconds after the restart to fire in on the rebound as Bayern looked sharper than in recent weeks despite an injury to Bastian Schweinsteiger early in the first half and with Dutchman Arjen Robben on the bench.
Second division Greuther Fuerth booked their first ever semi-final spot, stunning 10-man Hoffenheim 1-0 and leaving coach Holger Stanislawski's future in doubt thanks to a 44th-minute goal by Canada international Olivier Occean.
Borussia Monchengladbach needed extra time to oust Hertha Berlin 2-0 thanks to a Filip Daems penalty and a 120th-minute goal by Oscar Wendt.
Hertha, who had Roman Hubnik sent off for head-butting Igor de Camargo that led to the spot-kick, have now lost all four matches - including three league games - since coach Michael Skibbe took over.
Bundesliga leaders Borussia Dortmund beat fourth-division Kiel 4-0 on Tuesday to advance.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.