Midfielder Javi Martinez, who excelled in the 0-0 draw at Liverpool in the Champions League on Tuesday, completed a fine week by scoring Bayern’s winner midway through the second half.
Bayern, which trailed by nine points at one stage, stayed second due to Dortmund’s better goal difference.
Dortmund can restore its three-point lead with a win at home over Bayer Leverkusen on Sunday, but captain Marco Reus is out injured, Dortmund has failed to win in the last three league games, and Leverkusen is on a four-game winning run.
Elsewhere, Mainz ended its three-game losing run with a 3-0 rout of Champions League participant Schalke, Wolfsburg won 3-0 at third-placed Borussia Moenchengladbach, and Freiburg enjoyed a 5-1 rout of relegation-threatened Augsburg.
Fortuna Duesseldorf hosted last-placed Nuremberg later Saturday.