Three goals in the first 10 minutes gave the hosts a head of steam, but the Bavarians fought back with a goal from Javi Martinez, two from Franck Ribery and a winner from Arjen Robben to finish their record-breaking league season in dramatic style.
The win ensured that they top the Bundesliga by a massive 25 points ahead of second-placed Borussia Dortmund, and Heynckes thanked both Die Roten and Gladbach supporters for their sendoff on Saturday.
"My thanks go to the fans for this wonderful farewell, which shows me ..." Heynckes began, before needing a moment to compose himself. "It shows me that this is my home.
"This is an emotional moment for me. I started my playing career and coaching career at Gladbach. It would certainly have been more emotional if it had been at the Bokelberg [Gladbach's old stadium].
"I associate many triumphs, bitter defeats and some curiosities with it. I would like to heartily thank the Borussia fans for the wonderful farewell."
Bayern will now prepare for its Champions League final against Borussia Dortmund on May 25 at Wembley. A week later Heynckes will serve his final game as Bayern head coach, the DFB Pokal final against Stuttgart in which he could go out by winning a treble.