Despite dominating for long spells in the first-half, Madrid couldn't find a way past Celta goalkeeper Javi Varas until just after the hour mark when Ronaldo swept home a loose ball from close range.
The lead lasted barely two minutes as Iago Aspas' deflected effort wrong-footed Diego Lopez to bring Celta level.
However, for all his good work in the first-half, Varas was at fault for the winner as he clipped Kaka inside the area and Ronaldo stepped up to smash home the penalty for his 42nd goal of the season.
Jose Mourinho again rested a number of first-team regulars as he made seven changes from the side that defeated Manchester United in midweek.
Pepe was one of those recalled to the line-up and he stressed that it is important for Real to continue winning in the league, even if the Champions League and Copa del Rey are now their primary targets.
"We missed quite a lot of chances in the first half, but the team knew how to get through the difficult moments, fought hard and in the end the victory was deserved," he said.
"As Real Madrid players we are very concentrated on what we have to do.
"It will be very difficult to fight for the league but any player that puts on the Madrid shirt always has to be motivated and honour the jersey."
The changes did seem to have an effect early on as Celta started the stronger, but Madrid slowly started to take control and only a host of saves from Varas prevented them going into the break with a comfortable lead.
Ronaldo, Karim Benzema and Marcelo were all denied by Varas before Jose Maria Callejon also fired wastefully at the 'keeper when clean through on goal and Ronaldo hit the bar with a header from close range.
Xabi Alonso was introduced for Sami Khedira at the break and with the Spanish international orchestrating the midfield, Madrid finally went in front 16 minutes into the second-half.
Callejon's shot from the edge of the area after a corner had been punched clear by Varas was blocked, but Ronaldo was on hand to sweep the loose ball into an empty net.
However, Celta levelled with their next attack as Aspas spun inside the area and saw his shot deflect off Pepe into the net with Lopez stranded.
Ronaldo came to the rescue again, though, with 19 minutes remaining as he converted his second of the evening from the penalty spot after Kaka had been felled by Varas.
Real's win took them into second place as Atletico Madrid suffered their first home league defeat of the season against Real Sociedad.
Sociedad are now level on points with Malaga in fourth after Valencia missed the opportunity to move into the Champions League places as they were beaten 1-0 at Athletic Bilbao.
And there was controversy at the Ciudad de Valencia as Levante and Getafe drew 0-0.
The hosts were left furious with the officials after Vicente Iborra's long-range strike wasn't given as a goal despite appearing to have crossed the line.