Full-time from Griffin Park
Gregory gave The Lions into a deserved 28th-minute lead and when O'Brien nodded home the second with his first ever senior goal for Millwall, it looked as if the visitors were heading for a first victory since 10th February.
But with just five minutes of normal time remaining, Martyn Woolford was penalised for a foul on Bees' sub Alan Judge and Alex Pritchard smashed home the resulting spot-kick. Then in the first minute of injury-time Sid Nelson's attempted clearance fell invitingly for Moses Odubajo, who rifled home a heart-breaking equaliser.
Despite being the underdogs against Play-Off hopefuls Brentford, it was Millwall who started the stronger and Ed Upson, back in the team at the expense of Gary Taylor-Fletcher, forced a good save from David Button in the second minute before O'Brien saw his follow-up blocked.
Millwall made the deadlock on 28 minutes when Upson threaded a delightful through ball to Gregory, who showed great composure rounding the keeper and slotting the ball home.
The Upson-Gregory combination nearly worked moments later, but Gregory curled his first-time effort just over the bar.
First Stuart Dallas aimed a curling strike at the far corner, but the Millwall keeper made a spectacular fingertip save to keep the ball out and Forde was then on hand to palm away a point-blank Jonathan Douglas header.
Forde completed a hat-trick of top first-half stops just before the break when he dived low to his right to claw away Pritchard's 30-yard free-kick as the ball arrowed towards the bottom corner.
But it was Millwall who looked to have made the game safe just past the hour-mark when O'Brien, who is growing with confidence with every game, rose high at the far post to meet Woolford' inviting delivery from the left and headed home from close range.
However with five minutes remaining
Judge was sent tumbling by Woolford in the penalty area and up stepped Pritchard to send Forde the wrong way from the spot. Millwall still had opportunities to claim all three points; but Woolford, Gregory and Upson all had shots blocked in a scramble and then
With time ticking away and The Lions defending in numbers, an attempted clearance by Nelson fell invitingly for Odubajo, who fired home from 10 yards.
Taylor-Fletcher's crisp effort dropped inches wide of the post.
Button, Bidwell, Dean (Smith, 71mins), Douglas, Odubajo, Dallas (Judge, 60mins), Gray, Diagouraga (Toral, 71mins), Pritchard, Jota, Tarkowski. Subs not used: Bonham, Craig, McCormack, Long.
Scorer:Pritchard (85mins, pen), Odubajo (90+1mins)
Forde, Cummings, Harding, Abdou, Nelson, Hooiveld, Williams, Woolford, O'Brien (Taylor-Fletcher, 76mins), Gregory, Upson. Subs not used: Archer, Beevers, Gueye, Philpot, Maierhofer, Fabbrini.
Scorers:Gregory (28mins), O'Brien (64mins)