Niklas Sule and Corentin Tolisso struck in the first 19 minutes on their Bayern Bundesliga debuts to get the champions off to a flying start at the Allianz Arena.
But while Robert Lewandowski added a third from the penalty spot, Admir Mehmedi thumped in a consolation as Bayern let slip control of the match in a scrappy second half played in incredibly wet conditions in Munich.
"It was a tough game," Ancelotti said after his side's victory. "We scored early and then we did not defend well.
"We left too much space between the lines. This can happen in this phase. We have to improve. To keep a clean sheet, we must be more compact."
Bayern were without quintet Manuel Neuer, Javi Martinez, James Rodriguez, Thiago and Jerome Boateng, and Mats Hummels limped off in the second half to add to Ancelotti's injury concerns, while Thomas Muller was also replaced.
"Hummels had problems with his stomach," Ancelotti added. "The substitution of Muller was a tactical decision. We wanted to change the system."
Nur der Magen, nichts "Schlimmeres", der dafür ordentlich...— Mats Hummels (@matshummels) August 18, 2017
It's "just" the stomach nothing worse.
Sule's debut goal came nine minutes into his Bundesliga bow, heading in a free-kick from his former Hoffenheim team-mate Sebastian Rudy.
"This was a special day for me," centre-back Sule said. "The first game for my new club and my first goal. That was nice for me in front of a great stadium.
"It was not easy and we had a hard time. In the first half we had good chances. The second half has not gone so well. The freshness was missing. There were plenty of chances. The size of the victory may be a bit too high."