In his first game in charge since his return, Bayern were gifted an early lead when Julian Schuster put through his own net.
Kingsley Coman doubled the advantage at the Allianz Arena just before half time.
The gloss to the scoreline was added in the last 25 minutes thanks to goals from Thiago Alcantara, Robert Lewandowski and Joshua Kimmich.
“It was important to get off to a good start,” said Heynckes after the victory. “That gives a spring and some confidence to the players. It’s true that Freiburg had a couple of chances to score – I need to talk about that with the players – but apart from that it was a fine performance.”
Ancelotti, who led Bayern to the Bundesliga title last season – was dismissed less than 24 hours after Bayern lost 3-0 to Paris Saint-Germain in the second game of the Uefa Champions League group stages.
The defeat left them second in Group B behind PSG. Bayern were not far off the Bundesliga lead either at the time. By most objective standards, it was not a crisis. But in Germany, Bayern carries the nickname FC Hollywood. After the poor performances highlighted the internal malaise, the cameras were on the club and action was needed.
Heynckes added: "Up front, we need to show off our potential. There’s a lot of hard work in front of all of us. I’ve spoken to lots of the players and for me it’s important to give them freedom to play. And we probably saw the fruits of that in the five goal display against Freiburg.”
Bayern’s success coupled with Borussia Dortmund’s 3-2 defeat at home to RB Leipzig means Bayern are two points behind the pacesetters. Leipzig are third with 16 points after eight games.
After the boost in the Bundesliga, Heynckes must turn his attentions to the Champions League campaign. On 18 October, Bayern host Celtic in the third game. PSG are at Anderlecht.