Goalkeeper Sven Ulreich made the decisive save in the shoot-out, keeping out Dortmund defender Marc Bartra's effort after Lukasz Piszczek's bizarre own goal in the 88th minute had rescued Bayern.
Bayern defender Joshua Kimmich and Dortmund's Sebastian Rode both had spot-kicks saved and after Niklas Sule converted in sudden death to make it 5-4 to Carlo Ancelotti's side, Ulreich emerged as the hero.
Rummenigge steps down early as Kahn takes over as Bayern Munich CEO
Robert Lewandowski had cancelled out Christian Pulisic's opener for Dortmund before half-time before Pierre-Emerick Aubameyang's cool finish midway through the second period appeared to have sunk Bayern.
But the Bundesliga champions forced a late equaliser when the ball rebounded off Piszczek after a frantic goalmouth scramble, and then held their nerve in the shoot-out.
FC Bayern München, Borussia Dortmund
Image credit: Eurosport
Borussia Dortmund midfielder Nuri Sahin said the manner of his side's defeat had left a bitter feeling.
"We started the game very well, then we lost the thread, but we really moved through to the halfway point," the Turkey international told Dortmund's official website.
"The second half then went completely to us. That is why it is very bitter to have lost in the end."
Fellow countryman and Dortmund goalkeeper Roman Burki agreed his side had dominated after the interval, while Bayern's late scrambled equaliser was especially galling.
"We should not have let this game go into a penalty shoot-out. In the second half, only we played," he said.
This curious goal in the 88th minute is of course very annoying. It all went very fast, I cannot say exactly what we did wrong. The ball clatters the bar to the line, then it is actually only luck for the Bavarians that the ball goes (in).
"The video assistant has said that everything was correct, then it will have been the case. But again, we should not have let the game go into the penalty shoot-out."
Ulreich told his club's official website: "Of course I'm glad I could help the team in the shoot-out and win the title. We've seen some of the Bayern we want to see.
"In the first half we had countless chances we should have exploited. Unfortunately we conceded two goals, we weren't attentive then.
"But we've still won, it's fantastic, and we have to keep it up. We showed the right attitude today."
Lewandowski added: "We made a few mistakes but it's the first match of the season. We have to step it up even more now.
"I'm sure everything will be going perfectly in a few months. We'll surely be as strong as in the last or the second-to-last year."
Real confirm Alaba signing
Opinion: Robert Lewandowski is a living legend we don’t appreciate enough