The Bundesliga outfits were eligible to meet one another in the final eight, but the draw in Nyon pitted Bayern against Juventus and Dortmund against quarter-final debutants Malaga.
Bayern are one of the favourites for the competition, but they stumbled to a 2-0 defeat at the hands of Arsenal at the Allianz Arena this week.
Despite the blow, Bayern were able to qualify on away goals, while Dortmund clinched their place in the final eight courtesy of a two-leg win over Shakhtar Donetsk.
Champions League quarter-final matches:
Malaga vs. Borussia Dortmund
Real Madrid vs. Galatasaray
Paris Saint-Germain vs. Barcelona
Bayern Munich vs. Juventus