Albion finished with 10 men, defender Lewis Dunk collecting two bookings as his side slipped to their first defeat in six matches before a crowd of 27,186.
Brentford enjoyed early possession but Brighton came close to taking the lead in the ninth minute when ‘keeper David Button saved a shot from Inigo Calderon with his feet after a fine through ball from Craig Mackail-Smith.
Button was in action again shortly after to save an angled shot from Sam Baldock, whose first touch had taken him away from goal.
Brighton threatened again when good play from Mackail-Smith led to Solly March trying his luck from the edge of the area and his goal-bound left-foot shot was palmed away by the alert Button.
Jake Forster-Caskey was off target for the Seagulls midway through the half with a rising 25-yard drive after a short pass from March.
Brighton’s leading scorer, central defender Lewis Dunk, jumped too early from a corner by Danny Holla and his header was saved by Button in front of the Brentford fans.
Brentford, on a revenge mission following Brighton’s 2-0 victory in the FA Cup at Griffin Park two weeks ago, broke the deadlock through Gray in the 29th minute.
Stuart Dallas, cashing in on a mistake by Calderon, broke down the left and crossed for Gray who scored with a left-footed shot which looped over keeper David Stockdale after taking a deflection off Dunk.
Brighton had a let-off shortly after when, from a cross by Jake Bidwell, Gray put a header just wide.
The Seagulls were relieved to see a shot from Gray go wide just before the interval after a strong run unchallenged through the middle by defender James Tarkowski.
Button kept Brentford in front six minutes after the break by saving Mackail-Smith’s shot from 12 yards with his legs.
Brighton were reduced to 10 men on 61 minutes when defender Dunk received a second yellow card from referee Andy Davies for pushing over midfielder Jota.
Seagulls keeper Stockdale blocked a shot from Alex Pritchard before Gray put a header over at the near post.
Stockdale produced another fine save to keep out a goal-bound effort from skipper Jonathan Douglas before opposite number Button brilliantly denied substitute Adrian Colunga at the other end.
Substitute Jon Toral should have doubled Brentford’s lead three minutes from time inside the six-yard area, but Stockdale was able to nick the ball from him.