Mikel Arruabarrena had given the hosts the lead shortly after the half-hour mark from the penalty spot but Alberto Bueno levelled in the 40th minute and moments later Manucho put Paco Jemez’s side in front.
The visitors survived a late onslaught to record a third straight victory that takes them on to 38 points for the season while Eibar slumped to a 10th consecutive defeat, made worse by Raul Navas being sent off for a second booking in injury time.
Eibar made the better start to the game and squandered several chances to take an early lead.
Rayo were grateful to goalkeeper Cristian Alvarez for making a fine double save to deny Federico Piovaccari, while Ander Capa and Eneko Boveda both failed to hit the target from clear openings.
However, Eibar did eventually take the lead when Alvarez bundled Piovacarri to the floor in the area, and Arruabarrena smashed the resulting spot-kick past the Argentine custodian.
Conceding a goal seemed to waken Rayo, who came straight back at their opponents and could have levelled when Manucho out-jumped Eibar goalkeeper Jaime Jimenez but his header was cleared off the line by Txema Anibarro.
Rayo found the equaliser less than a minute later. Tito sent the ball back into the box after Eibar had cleared and Bueno was waiting at the back post to nod in his 16th league goal of the season.
And they took the lead barely two minutes later, as Manucho trotted towards the near post unmarked to head in a corner.
Rayo should have extended their lead on a couple of occasions after the break, with Manucho first mishitting a clear shot at goal and then seeing his close-range header tipped over the bar by Jaime.
But the visitors spent the final minutes of the game in their area trying to avert an Eibar fightback.
First Manu del Moral missed the target from inside the box, then Tito headed Navas’ header off the line, and in the final minute Alvarez again came to his side’s rescue to keep out an acrobatic close-range effort from Del Moral.
Eibar knew their best chance to avert their losing streak had gone, and, perhaps in frustration, Navas picked up two bookings in the space of half a minute and was sent off.