Eibar's Ivan Ramis had equalised in between to give the home side hope.
Ronaldo's bullet header from Dani Carvajal's cross in the 84th minute earned Madrid the three points.
But Ronaldo's two goals mean he has now scored in seven consecutive games and boasts a remarkable 13 goals overall in that period.
Madrid - who lost Raphael Varane to a head injury - gained a foothold, though, with Gareth Bale forcing the approaching Marko Dmitrovic into action in the 32nd minute. He knows that he's going to score, he's very positive.
But he was back on the pitch to see Cristiano Ronaldo score his second goal of the game with what turned out to be the victor. He's a different and special player.
The win has now temporarily closed the gap between Real and their fierce rivals Atletico Madrid to four points as Zidane's side look to stay in touching distance of the top two.
After the intermission, and with a goal in their pocket, Real Madrid tried to slow the game's pace, but Eibar did not allow them to.
They were below their best and rode their luck late on when Eibar should have converted a pair of excellent chances, before Ronaldo made them pay.
"For me, he's from another galaxy", Real coach Zidane said.
Bale struck his eighth Liga goal of the season by opening the scoring in Real's 3-1 win over Getafe on Saturday, though his half-hearted celebration was also seen as a sign of his discontent at being dropped from the starting 11.
Real Madrid's form prior to the last 16 clash against the French giants raised many questions as to whether they could withstand the attacking strength of Unai Emery's side.