Juergen Klopp had led Dortmund to two Bundesliga titles and a Champions League final during his seven years in charge of the German club.
Both Dortmund and Bayern have won their opening three matches but Dortmund has scored one more goal.
The 47-year-old crowd favourite is leaving after having taken over in 2008 and leading Dortmund to the Bundesliga title in 2011.
Manchester City take on Barcelona and Juventus face Dortmund as the Champions League gets into its stride.
Dortmund finally struck five minutes after the restart as Neven Subotic beat his marker to head in a corner.
Arsenal beat Dortmund 2-0 to leave struggles behind, seal knockout passage in CL.
Dortmund beat Bayern 2-0 in German Super Cup on Wednesday to win the first domestic title of the season.
Bayern Munich will not sign any more players during the current transfer window despite a series of injury setbacks.
DFB media director Ralf Koettker dismissed suggestions the goal was initially awarded by the linesman.
Bayern Munich is winless since clinching the title with a record seven matches to play.
Dortmund, however, boosted their own confidence with a 2-1 comeback win over VfL Wolfsburg on Saturday.
Taking over at Dortmund in ’08, Klopp led them to successive league titles in his 3rd and 4th years.
Los Blancos face runners-up Dortmund in the CL quarterfinals with both teams struggling for form.
Red Devils draw Champions Bayern Munich in CL quarterfinals.
Dortmund held on in a scrappy finale and the 2-1 defeat was enough to send them into the last eight.