Bundesliga top scorer Mario Gomez fired in from five metres for Bayern to break the deadlock on the hour with his 17th league goal of the season. Arjen Robben added another in stoppage time to lift Bayern to 40 points from 19 games.
Dortmund stayed hot on their heels with Japanese offensive midfielder Shinji Kagawa scoring twice and Kevin Grosskreutz adding another as they eased past Hoffenheim.
Kagawa grabbed a 16th-minute lead and Grosskreutz doubled it in the 31st minute as Dortmund quickly took complete control of the match.
The Japanese added another goal 10 minutes after the restart, firing in from close range after a fine one-two with Grosskreutz. Fabian Johnson cut the deficit for the visitors.
Schalke, third on 37, can join the two teams on 40 points later on Saturday with a win at Cologne (1730 GMT).
Champions League competitors Bayer Leverkusen came from a goal down to draw 1-1 at Werder Bremen and remain in sixth place on 30 points, one behind their opponents.
Hamburg SV recovered from last week’s 5-1 mauling by Dortmund to beat Hertha Berlin 2-1 and move up to 11th on 22.
Fourth-placed Borussia Moenchengladbach, on 36 points, can move back to within a point off the top with victory at VfB Stuttgart on Sunday.