
Joselu fired the visitors in front early on but former Madrid youth player Raul de Tomas levelled for Rayo from the penalty spot in coach Inigo Perez’s first match at the helm.
Carlo Ancelotti’s side stretched their lead on Girona, second, to six points, before the Catalan minnows face Athletic Bilbao tomorrow.
After Los Blancos thrashed Girona last weekend to take a five-point lead in the title race, the draw allows their closest pursuers a chance to cut the gap.
Dani Carvajal was sent off at the death for Madrid after appearing to elbow Kike Perez.
Rayo, 14th, sacked Francisco Rodriguez earlier this week and appointed Perez, with Real’s visit a baptism of fire.
It took only three minutes for Real to take the lead, with Fede Valverde racing down the right on a sharp counter-attack.
The Uruguayan crossed for Joselu to bundle home and despite initially being called offside, VAR showed the goal should stand.
Joselu headed home a second but this time it was correctly disallowed after Lucas Vazquez had taken the ball out of play before crossing for his Spanish compatriot.
Despite taking an early lead, Real failed to create many clear openings.
Los Blancos were without top goal scorer Jude Bellingham, currently recovering from an ankle injury.
They earned a 1-0 win over RB Leipzig in the Champions League in midweek and perhaps tiredness told against an energised, hard-working Rayo.
The hosts pulled level through De Tomas’ penalty after 27 minutes, slammed down the middle after Eduardo Camavinga handled Oscar Trejo’s shot.
Valverde, heavily involved, cracked a shot against the post from 20 yards as Real looked to restore their lead.
At the other end Andriy Lunin was alert to save at the near post from Alvaro Garcia after Rayo picked Luka Modric’s pocket.
Substitute Toni Kroos forced a good save from Rayo goalkeeper Stole Dimitrievski with a freekick as the clock ticked down.
The Macedonian stopper also fielded a long range Carvajal drive in stoppage-time.
The defender was then dismissed for swinging an elbow at Kike Perez in frustration after his shirt was pulled to earn a second yellow card and end a disappointing afternoon for Real.
Later today, Granada face Almeria in a battle between the bottom two, while Real Sociedad visit Mallorca and Real Betis host Alaves.