Ronaldo, already the competition's all-time highest goalscorer, became the first player in history to convert in all six group-stage matches when he gave Los Blancos a two-goal lead, but Lucas Vazquez clinched the win in the 81st minute after Pierre-Emerick Aubameyang's double levelled.
Borja Mayoral took just eight minutes to make the most of replacing the misfiring Karim Benzema as one of five changes by Zinedine Zidane, finding the back of the net for the first time in the Champions League.
Madrid's blistering start continued as Ronaldo curled home his landmark effort one day before finding out if he will match Lionel Messi's record of five Ballons d'Or, though Dortmund halved the deficit when Aubameyang punished the defending champions for over-playing at the back.
Aubameyang has never hidden his desire to play for Madrid and it would have been hard for the home fans not to admire the clever second-half chip over Keylor Navas that looked likely to earn Peter Bosz's struggling side a draw.
Vazquez had other ideas, though, as the hosts, who were already guaranteed to finish second prior to kick-off, picked up their first win in three matches.
Dortmund pipped APOEL to a place in the Europa League despite an eighth outing in all competitions without a victory.
Mayoral wasted no time in rewarding Zidane's faith, dinking Isco's flick-on – which he may have intended to control for himself – over the onrushing Roman Burki to convert his first opportunity.
But four minutes later it was Ronaldo who took centre stage, the 32-year-old claiming yet another record with a display of exquisite technique. He took one touch to control Mateo Kovacic's cutback, quickly adjusted his feet and bent a sublime finish into the top-right corner.
Theo Hernandez drilled wide after some neat interplay with Ronaldo, but Dortmund soon awoke from their slumber and Raphael Varane's interception stopped Aubameyang turning Christian Pulisic's cross home in the 25th minute, though it came at a cost with the Frenchman seemingly picking up an injury that forced him off.
Shinji Kagawa was kept out by Navas after more fine work from Pulisic, before Aubameyang failed to make the most of a sight of goal when he dragged wide from the right side of the box.
Dortmund's efforts were rewarded two minutes before the break, though. Marcel Schmelzer caught Vazquez and Varane's replacement Marco Asensio idle near Kovacic's loose pass and the left-back whipped a brilliant delivery into the box that Aubameyang headed beyond Navas.
Within three minutes of the restart BVB were level as Aubameyang stepped inside of Sergio Ramos and, after being denied by Navas at the first attempt, showed incredible composure to chip the goalkeeper.
A high press from Isco gave Ronaldo a chance to move into double figures in this season's Champions League, but the Portuguese pulled wide from the right of the area.
Vazquez saw a powerful drive held by Burki as Madrid stepped up a their attempts for a winner, which Ronaldo thought he had when he swept home Casemiro's knockdown only to see the flag up for offside.
It finally came when Vazquez's volley with the outside of his right foot beat Burki low to his left, but Kagawa fired a great chance to salvage a point over with just two minutes remaining.
Key Opta stats:
- Cristiano Ronaldo is the first player to ever score in each of the six games of a Champions League group round (nine goals).
- Borja Mayoral has scored his first goal in his first start in Champions League and with his first shot on target in the competition.
- Cristiano Ronaldo has equaled Lionel Messi as the player with the most goals scored in the Champions League group round (60 apiece).
- Borussia Dortmund have lost six Champions League games against Real Madrid, more than against any other opponent.
- Pierre-Emerick Aubameyang has scored four goals against Real Madrid in the Champions League, his favourite opponent in the competition.