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...

.
Leeds United striker Patrick Bamford embraced by Tyler Roberts at full-time. Photo: Getty

. Elland Road watches on
The home crowd takes in the early exchanges at Elland Road. Photo: Tony Johnson

. Another sold out crowd
35,639 packed into LS11 to take in the Premier League action. Photo: Tony Johnson

1. Elland Road watches on
The home crowd takes in the early exchanges at Elland Road. Photo: Tony Johnson

2. Another sold out crowd
35,639 packed into LS11 to take in the Premier League action. Photo: Tony Johnson

3. A needed lift
A slow start to the game is given a lift by the home crowd, with Leeds slowly asserting themselves on proceedings. Photo: Tony Johnson

4. Roberts slides in
Raphinha's first ball is blocked, his second is wonderful. It's dipping and finds the run of Roberts who guides the ball into the far corner. Photo: Tony Johnson

5. Roberts celebration
Not sure what the celebration is all about... but it's a goal for Roberts on his 100th Leeds United appearance. Photo: Tony Johnson

6. Roberts mobbed
An important moment for Tyler, who gets his second Premier League goal of his career. Photo: Tony Johnson