Madrid had too much firepower as Gareth Bale, a Tomasz Jodlowiec own goal and Marco Asensio handed the hosts a comfortable half-time lead despite Miroslav Radovic’s penalty.
Lucas Vazquez and Alvaro Morata came off the bench to round off the scoring after the break.
Dortmund beat Sporting Lisbon 2-1 in the other game in the group, meaning Madrid and the Germans remain tied at the top of the pool on seven points.