Douglas Costa scored the only goal for the holders when his shot was deflected in by Luiz Gustavo.
Bayern keeper Manuel Neuer made two good saves to deny Yunus Malli in the closing stages.
There were also cup wins for Hamburg, who beat Cologne 2-0, Borussia Monchengladbach, who dismissed Greuther Furth 2-0, and second division Arminia Bielefeld on Tuesday.
Arminia needed penalties to get past Astoria Walldorf of the fourth tier.
Borussia Dortmund host Hertha Berlin in the pick of Wednesday's last-16 ties.
Bayern Munich reached the German Cup quarter-finals by beating Wolfsburg.