Leeds lost captain Liam Cooper to injury inside the opening quarter of an hour but United went ahead in the 27th minute when Tyler Roberts flicked home a Raphinha cross.
Brentford equalised nine minutes after the break as Shandon Baptiste converted from the middle of the box, shortly after United star Kalvin Phillips had pulled up injured and was eventually replaced by Mateusz Klich.
The Bees then bagged what looked set to prove the game's winning goal seven minutes later when a Bryan Mbeumo through ball played in Sergi Canos who smashed home a clinical finish past Illan Meslier.
But Bamford returned from two and a half months out through an ankle injury as United's third and final substitute in the 68th minute and kneed home a corner in the 95th minute with a finish that flew in off the underside of the bar.
Graham Smyth, the YEP's chief football writer, hands out the scores from another dramatic game at Elland Road.

7. Adam Forshaw
7 - Tidy, efficient. Covered a lot of ground to link the play. Struggled to shut down the Bees midfield after Phillips' exit. Picture by Mike Egerton/PA Wire.

8. Stuart Dallas
7 - Some nice bits of play. Kept trying to attack, unable to produce that much in the final third. Beaten by Henry in the lead-up to the first goal. Photo by George Wood/Getty Images.

9. Raphinha
7 - Lovely assist for the first, great corner for the second. Flashes of skill but for much of the game nothing was happening for him. Photo by George Wood/Getty Images.

10. Dan James
6 - Busy, battled, pressed and tackled. On the ball just couldn't make something happen or beat men. Offside too often. Picture by Tony Johnson.

11. Tyler Roberts
7 - Deserved his goal for his first half show. Involved in lots of nice stuff before the break. Faded in influence after it. Photo by George Wood/Getty Images.

12. Jack Harrison (sub)
6 - The effort was there but he couldn't get the better of his man. Had to cover a lot of ground on the left. Photo by George Wood/Getty Images.

