Leo Baptistao had headed Rayo into an early lead but two goals from Joan Verdu either side of half-time put Espanyol 2-1 in front before Leo slotted home his second of the game just after the hour mark.
However, after both sides had been reduced to 10-men as Diego Colotto and Mikel Labaka both saw red it was substitute Stuani who was the hero as he powered home Sergio Garcia's cross to bring relief to the Cornella El Prat.
The Espanyol faithful had made their feelings on Los Pericos awful start to the season clear as the game kicked off in front of a less than half full stadium and the home fans weren't encouraged any further when the visitors went in front after just 11 minutes.
Leo intercepted a sloppy Verdu pass to run through on goal and after his initial effort was well saved by Cristian Alvarez, the Brazilian's follow-up header was deemed to have crossed the line before Hector Moreno hooked the ball clear.
The home side's response to going behind though wasn't one of a side lacking in confidence as they went on to boss the rest of the opening half.
Verdu was extremely unlucky not to make amends for his previous error on 21 minutes as he struck the post from Mubarak Wakaso's knockdown but the former Barcelona playmaker only had to wait another 15 minutes to level the scores as he raced onto Victor Sanchez's wonderful pass to calmly slot past Ruben Martinez.
Verdu was on target again just three minutes into the second-half despite Ruben's best efforts as after he saved brilliantly from Juan Forlin, the ball fell perfectly for Verdu to smash home his fourth goal of the season.
However, despite that double blow either side of the break, Rayo then began to come back into the game and were level once more when the Espanyol defence couldn't dispossess Alejandro Dominguez as he weaved his way through the middle and the ball rebounded to the feet of Leo who took a touch before sweeping the ball low in the net.
Within five minutes the visitors seemed to have handed Espanyol the advantage once more as Labaka was shown a straight red card for an ill-timed lunge on Javi Lopez, but, in keeping with how the game had gone, the numbers were soon evened up when Colotto stupidly blocked Leo on the halfway line to see his second booking of the day.
If anything it appeared as if Rayo were going to go on and take all three points as Tito came within inches of putting them back in front and Alvarez had to be quick off his line to deny Adrian, but the Espanyol sucker punch arrived two minutes into added time as Garcia swung over a wonderful cross from the left and Stuani was on hand to give Ruben no chance with a thunderous header from close range.