Gotze had left Dortmund for Bayern in 2013, but never settled down. He was mostly seen on the bench under previous manager Pep Guardiola.
New Bayern boss Carlo Ancelotti had a talk with Gotze before assuming the post, and reportedly did not try to keep the player who scored the winning extra-time goal that gave Germany the World Cup title over Argentina at the 2014 World Cup in Brazil.
At the European Championship in France that ended earlier this month, Gotze did not play a major role.
Dortmund announced on Thursday that Gotze will sign a four-year contract once he passes the medical examination. Details of the deal have not been released.