Initially on the bench, Gotze came on early in the second half and, ten minutes later, he had the ball in the back of the net, raising his hands apologetically.
Two goals in two minutes from Arjen Robben and Thomas Muller wrapped up victory, although Dortmund could feel hard done by after doing most of the attacking and creating the better chances before Gotze's opener.
Just days signing a short-term contract until the end of the season, Manuel Friedrich found himself thrust straight in at the deep end in arguably the biggest game of the season, alongside Sokratis Papastathopoulos at the heart of the Dortmund defence.
Bayern boss Pep Guardiola opted for a 4-1-4 1 formation with Philipp Lahm sat in front of the defence, but former Dortmund midfielder Gotze was rather surprisingly left on the bench.
Dortmund's makeshift defence was hardly put to the test in the first half as Bayern lacked any invention and the hosts exuded more confidence.
A dangerous Kevin Grosskreutz cross caused problems in the Bayern defence with Dante cutting the ball out ahead of Manuel Neuer and Jerome Boateng cleared the danger as the yellow shirts arrived on the scene.
Marco Reus had a good chance in the 29th minute after a slip by Boateng, but he was denied by Neuer.
Bayern were looking a shadow of their usual self and Dortmund sensed their opportunity but another chance went begging five minutes into the second half. Sven Bender lifted the ball into the six-yard box and Robert Lewandowski lost his marker Rafinha but failed to make contact with his head as the ball finished just wide of the far post.
Gotze made his entrance for an anonymous Mario Mandzukic in the 56th minute, receiving the inevitable whistles from the home fans.
Yet it was still Dortmund doing all of the attacking, Boateng at full stretch to lift the ball away from Reus and deny him a one-on-one situation with Neuer in the 61st minute.
Five minutes later, those whistles for Gotze turned to shocked silence as he put Bayern in front.
Muller sent in a low ball from the right to the Germany midfielder who, from a position just inside the penalty area, prodded the ball almost with his toe-end into the far corner with Roman Weidenfeller's hand too weak to keep it out.
Dortmund threw caution to the wind and Henrikh Mkhitaryan missed a great chance to level in the 71st minute but as the home side searched for an equaliser they were punished at the back.
Thiago Alcantara played the ball into Robben's path and the Dutchman lifted the ball over Weidenfeller and into the far corner in the 85th minute.
Two minutes later, Dortmund's defence, now clearly in disarray, was breached again. Lahm squared for Muller to sweep a shot past Weidenfeller from close to the penalty spot and wrap up victory.