Mikel Vesga's header looked set to earn Leganes a valuable victory in their fight against relegation but Yedder sneaked in to score in the 91st minute and earn Sevilla a 1-1 draw.
The visitors were the ones celebrating at the final whistle but they head into the winter break two points behind Atletico Madrid and five adrift of leaders Barcelona.
The gap could easily have been greater. Leganes twice hit the woodwork, the second time just moments before Ben Yedder equalised at the other end.
But they have now won two and drawn three of their last five games, an encouraging run that has put four points between them and the relegation places.
Sevilla had been top almost exactly a month ago and even if few would see Pablo Machin's side as genuine title challengers, this was a match they would have hoped to win.
Key absentees like Ever Banega and Pablo Sarabia were missed while a rain-soaked Butarque made playing conditions difficult.
Leganes were ahead after five minutes as Vesga rose high to meet Allan Nyom's chipped ball into the area, and flicked it into the corner.
Twice they were denied a second by the woodwork, each time from headers, as Dimitrios Siovas and then Youssef En-Nesyri watched efforts crash against the crossbar.
Roque Mesa had nodded onto the post as well for Sevilla and it was his cross that supplied the equaliser in the first minute of added time. Yedder nipped in at the back post and, completely unmarked, made no mistake.
There was late drama earlier on Sunday too as Cristiano Piccini scored a 94th-minute winner for Valencia against Huesca.
Huesca, who are bottom of the table, had pulled level after Juan Hernandez's penalty cancelled out Dani Parejo's opener at Mestalla. Piccini's goal moves Valencia up to eighth.