The Whites, for a second time in five days, required a goal deep in added time in LS11 to secure a positive result on home soil.
Marcelo Bielsa's side caused more chaotic scenes thanks to the returning Bamford, who was handed his first appearance since mid-September due to an ankle injury.
The 28-year-old forward reacted quickest to a flick on from a Raphinha corner to turn the ball home from his knee off the underside of the bar.
The strike came in the fifth minute of injury-time on his comeback and helped move Leeds six points clear of the top flight drop zone.
United's No 9 was introduced from the bench with around 20 minutes to go after the Bees had turned the game on its head in the second half.
Brentford trailed following a Tyler Roberts opener on his 100th Whites match but goals from Shandon Baptiste and Sergi Canos put Thomas Frank's outfit ahead.
Leeds battled back and grabbed a stunning draw just seconds before time expired which caused more wild scenes in the home stands.
"I always felt when I came on the pitch I was going to get one chance," Bamford reflected at full-time, with a smile on his face.
"It didn't come for ages and ages but I still thought there was time. [Adam] Forshaw said to me that I was going to get one chance and it came.
"The message [from the bench] was just to just try and give a presence in the area and spin behind, don't drop too short and just try and do what you can.
"I just tried to stay in the box as much as I could and hope I put myself in the right position."
Here, we take a look back at another eventful afternoon through the camera lens...