The visitors went behind early on as Raul De Tomas netted, but they responded courtesy of goals from Borja Iglesias and Esteban Granero.
However, Rayo secured a point that moved them out of the relegation zone with a Gael Kakuta penalty.
De Tomas gave Rayo a flying start in the sixth minute, finding the bottom corner from outside the box, yet Espanyol came storming back.
They were level 13 minutes later as Iglesias equalised from close range before Granero fired a loose pass into the bottom corner on the stroke of half-time.
Former Chelsea player Kakuta levelled two minutes after the interval from 12 yards following a foul on Luis Advincula.
Espanyol thought they had secured a penalty at the death but the VAR ruled that the foul happened outside the box.