Clayton Donaldson's late header earned Brentford victory at Notts County.
The Magpies went ahead when Tony Craig turned the ball into his own net after good work by Jamal Cambell-Ryce and Julian Kelly.
Adam Forshaw was sent free by Marcello Trotta to level for the visitors - a goal Notts hotly disputed was offside.
Donaldson reacted first in the box to head in Brentford's winner - his 14th goal of the season - after a goal-line clearance from Shaleum Logan's cross.
Alan Sheehan had the best chance of the second half for Notts, but saw his goal-bound shot saved by Simon Moore.
The visitors have moved up to second in the League One table while Notts slip to eighth, two points adrift of the play-offs.
It stretched Brentford's unbeaten run to nine matches, while Notts were beaten at home for the fifth time this season.
VIEWS FROM THE DRESSING ROOM
Notts County manager Keith Curle told BBC Radio Nottingham:
"We started the game very well, on the front foot, playing the way that we wanted to play, getting the ball down and playing.
"[There was] good movement, good rotation in our play and we looked a threat.
"I think their goal changed the game as well. I've looked at it, it was a yard offside and that deflated us."
Brentford manager Uwe Rosler told BBC London 94.9:
"I think the best recipe to ensure we continue our run is to keep our feet on the ground.
"Let the journalists and other people talk but we must go back to business.
"We had a very hard game today and, on Tuesday, we have an unexpected FA Cup game waiting for us.
"To win this game in the last minute was fantastic."