After Rodrigo's deflected strike put Leeds ahead inside fifteen minutes, the Whites squandered bags of strong chances to extend their lead.
Kenny McLean looked to have rescued a point for the visitors with moments left to play as he poked home a Teemu Pukki cross, but 19-year-old substitute Joe Gelhardt had the final say in injury time.
The victory took the fifth-bottom Whites four points clear of the Premier League drop zone with nine games left, although second-bottom Burnley who are five points adrift have two games in hand.
Graham Smyth, the YEP's chief football writer, hands out the scores from Sunday afternoon's epic clash at Elland Road.
1. Illan Meslier
7 - A huge save right at the end from Pukki aside there wasn't a huge amount for him to do.
Photo by George Wood/Getty Images.
2. Luke Ayling
8 - Showed grit, worked hard, played some nice stuff.
Photo by George Wood/Getty Images.
3. Pascal Struijk
7 - Some nice passes and solid defending for the most part but let Pukki run off him for the goal.
Photo by George Wood/Getty Images.
4. Diego Llorente
7 - Full blooded defending but neither he nor Struijk could keep Pukki entirely quiet throughout and he left McLean alone for the goal.
Photo by George Wood/Getty Images.
5. Stuart Dallas
7 - Wasn't flawless defensively but was better in possession than he has been.
Photo by Stu Forster/Getty Images.
6. Adam Forshaw
7 - Quietly efficient. Had to dig in and defend doggedly towards the end.
Photo by Michael Regan/Getty Images.