In the 84th minute, Pedro Leon gave away possession too easily, allowing Modric to feed Daniel Carvajal out wide.
Ronaldo has roared back from a feeble start to the season, when he scored just once in his first eight league games, to reach 18 goals in the campaign. Only Lionel Messi has a longer current run (10).
Gareth Bale was denied by a fine block from Marko Dmitrovic but moments later, the visitors went ahead when Ronaldo collected Luka Modric's exquisite pass over the top of the defence before finding the bottom corner of the net from 12 yards.
"The worst part is that their goals both came from our mistakes", Dmitrovic said.
Ronaldo's goals were his 17th and 18th in the league.
Eddie Hearn: 'Anthony Joshua to crack America in next 12 months'
And Hearn has insisted that a shock union between himself and the former heavyweight champion would help set up the British super-fight.
Madrid defender Raphael Varane was substituted in the 26th after a blow to the head.
It was Nacho Fernandez who replaced Varane following his aerial collision, however only Ramos and Theo Hernandez remain as Madrid's established central defenders now available for selection.
"It's true that after 15, nearly 20 days, Luka came in and played a great game", Zidane said. "We knew we were going to suffer and we did, we had trouble getting hold of the ball but we fought together with character and got the win".
Before kick-off, Atletico Madrid and Barcelona had been the only two sides to leave Eibar with all three points since the end of October and Zinedine Zidane's side struggled to get to grips with their wingers during the early exchanges.
Real now sit just four points behind Atletico in the standings, while Eibar remain in eighth despite a valiant effort against the defending champions.