Jonathan Douglas scored therears before half time but Douglas powered home a header to make it 3-1.
And that proved to be the winner as Brighton could not build on a fine goal from Danny Holla that made it 3-2 on the hour.
The visitors pressed but Brentford held firm and took the points.
Brighton came to Griffin Park with a very offensive mind-set.
They played three attackers high up the pitch, their midfield players joined in and their full backs were allowed to push on.
They had the better of the opening 20 minutes and should probably have been a couple up, rather than a goal down.
Andrew Crofts hit the post inside the first five minutes and João Teixeira was just unable to turn in a Sam Baldock cross soon after.
Joe Bennett blasted over when well-placed, Teixeira saw a shot blocked and a Baldock looping header was saved.
Brentford had been pressed back in the early stages, unable to get their passing game going, loose sometimes in possession and forced on to the defensive.
The one time they got a good sight of goal was the game’s real controversial moment, although it proved immaterial to the end result.
James Tarkowski played a ball through, Douglas dummied and Gray got in, he was pulled back by Lewis Dunk and referee Stephen Martin signalled for a foul.
The official awarded a free kick outside the penalty area but decided Dunk had not denied a goal scoring opportunity despite Gray being through on goal.
Jota drilled the free kick under the wall but inches wide.
It looked as if that would be a key moment as Brighton continued to press.
They should probably have been ahead when Baldock got on to an Adrian Colunga ball and rounded David Button but the ball took a while to come down and Tarkowski got back to clear the shot off the line.
And seconds later, the visitors were behind.
Brentford broke quickly from Tarkowski’s clearance, Alan Judge fed Odubajo in the inside right channel, he got away from Bennett and drilled a shot past David Stockdale and in to the far corner.
The Bees may have been fortunate to be ahead at that point, and they could have been pegged back immediately when Colunga lashed well over from ten yards, but the goal gave them a boost of confidence.
The home side upped their game, started playing the slick football that has been a Brentford trademark in recent years and caused Brighton no end of problems.
Gray forced Stockdale in to a fine reaction save after good work from Alan McCormack and the Brighton defence were forced in to a desperate clearance when Odubajo got away again on the right.
Jota shot over after a nice turn, Judge was denied by a fine recovery tackle, Gray had a shot blocked inside the penalty area and there were numerous clearances by an overworked Brighton defence.
The second goal appeared to be a matter of time but it was magnificent when it came.
Odubajo raced down the left and fed the overlapping Jake Bidwell, he delivered an inch perfect cross for Gray to convert from close range.
Brentford were rampant at that point but Brighton regrouped and got a foothold in the game before half time.
It came from a Holla corner, Crofts nodded down and Gordon Greer lashed it in at the far post.
The visitors thought they had levelled from their next corner, Greer against putting the ball in, but Mr Martin had spotted an offence and brought an end to a thrilling first half soon after.
Brentford came out of the blocks quickly after the break, looking to restore their two-goal cushion.
Judge was robbed as he prepared to shoot following a good pass from Gray and when Jota got away from Iñigo Calderón his low cross was held by Stockdale.
Odubajo almost got Brentford’s third when he got away on the right side, picking up a Judge pass and cutting inside before firing just wide.
The third goal did come nine minutes in to the second half.
Bidwell was again the architect, keeping a pass from Pritchard in play and exchanging passes with Jota before delivering a cross that was perfect for Douglas to powerfully head home from eight yards.
Odubajo had a shot blocked and Judge, who had played him in, fired the loose ball over as Brentford again threatened to run riot.
Pritchard fired across the face of goal moments later but on the hour mark Brighton were back in it again.
Teixeira created some space with some nifty footwork and Holla curled the ball past the despairing Button from 25 yards.
Stockdale denied Pritchard and Judge as Brentford continued to go forward but Bennett should have levelled at the other end when he was put in by Teixeira but he shot across the face of goal and wide with only Button to beat, albeit from a narrow angle.
Gary Gardner shot over from distance and Bennett headed wide as Brighton pressed while Brentford attempted to take the sting out of the game by keeping the ball and making the visitors chase it.
Brighton probably had the impetus in the later stages but Brentford were nullifying them by and large and breaking when they had the chance.
Gardner had a shot blocked while Stuart Dallas blasted over after cutting inside at the other end.
Calderón missed the target from distance and Stockdale, up for a corner, missed the target with an acrobatic effort in the dying stages.
Brighton pushed but Brentford were solid and got their win.
Brentford: Button; McCormack, Tarkowski, Dean, Bidwell; Douglas; Odubajo, Pritchard (sub Toral 75 mins), Judge, Jota (sub Dallas 63 mins); Gray (sub Proschwitz 69 mins)
Subs (not used): Bonham, Craig, Tébar, Diagouraga
Bookings: Douglas (24 mins) (second of season)
Brighton and Hove Albion: Stockdale; Calderón, Greer, Dunk (sub Hughes h/t), Bennett; Crofts, Holla, Gardner; Colunga (sub LuaLua 63 mins), Baldock, Teixeira (sub Mackail-Smith 75 mins)
Subs (not used): Walton, Saltor, Forster-Caskey, Ince
Bookings: Dunk (13 mins), Baldock (49 mins)
Attendance: 10,089 (1,598 away fans)
By Chris Wickham