Ronaldo was on hand to give the visitors the lead in the first half, as he netted for the seventh consecutive game in a row.
Eibar battled back after the break and levelled up on 50 minutes when Ivan Ramis headed home a corner. However, Ronaldo was perfectly placed late on to snatch the win for the visitors, as Dani Carvajal's cross found its way to the forward with five minutes remaining.
Los Blancos remain in third but have put some pressure on Atletico ahead of their meeting with Celta Vigo on Sunday. Real are 12 points behind leaders Barcelona, who travel to bottom club Malaga on Saturday evening.
With no Karim Benzema in the side, there was pre-match intrigue as to how Madrid would set up. ESPN FC's Dermot Corrigan provided detail:
It took Madrid some time to get used to the system, as it was the home side that started the brighter of these two, with Kike Garcia bringing a smart save out of Keylor Navas at the end of a slick counter-attack.
Given Eibar were dominating possession at this point in the contest, it wasn't a surprise to see Madrid eventually take the lead after a break from deep.
Luka Modric was the architect, as he aimed a perfect pass into the path of Ronaldo, who controlled and finished expertly. As noted by Squawka Football, the Portuguese is in tremendous form at the moment:
It was a goal that took some of the sting out of the Eibar attack, and Ronaldo nearly doubled Madrid's lead before the break, as his strike was pushed away by Marko Dmitrovic.
Having looked a little jaded before the break, it was to Eibar's great credit that they came out of the traps on the front foot again in the second half. And this time they were able to register something tangible for their play.
The goal came from an unlikely source, as Ramis ventured forward from a corner, escaped the attention of Sergio Ramos and planted a header past Keylor Navas. Per Corrigan, it was disappointing play from the Madrid skipper:
It meant Madrid had it all to do again and they nearly found the perfect response when Gareth Bale crossed for Ronaldo. The forward was again foiled by Dmitrovic, though, as he showcased brilliant instincts to keep the effort out.
Eibar fancied their chances of grabbing a winner, as they opted against sitting in and taking a point. In the end, that may well have cost them a draw.
With the clock ticking down, Ronaldo played the ball wide to the right and darted into the box. The Madrid No. 7 remained untracked and met a stunning cross from Carvajal to give his side the lead.
As noted below, Ronaldo has really hit form in the second half of the campaign after a stuttering beginning to it:
Eibar went in search of a last-gasp equaliser, but they were unable to respond for a second time despite a flurry of late pressure.
Madrid were able to see the win out, and while they won't challenge for the La Liga title barring a big collapse from the top two, their form, and especially that of Ronaldo, bodes well for another tilt at the UEFA Champions League.