Arturo Vidal scored Bayern's first when he drilled home after his initial shot had been blocked.
Germany striker Thomas Muller then turned in from close range as defender Mats Hummels nodded down from a corner.
Forward Pierre-Emerick Aubameyang and recent signing Ousmane Dembele went close for Dortmund.
"It was difficult and Dortmund played very, very well," said Ancelotti, who took over from Manchester City-bound Pep Guardiola in the summer and has won his 18th title as a coach.
"But things worked much better for us after the break and this gives us some self-confidence for the Bundesliga.
"This team is already very, very strong."
The Bundesliga season starts on Friday, 26 August, when Bayern begin their title defence against Werder Bremen.
Carlo Ancelotti gained his first trophy as Bayern Munich coach thanks to their 2-0 victory over Borussia Dortmund in the German Super Cup.