Bees midfielder David Hunt opened the scoring just before the break with a rasping free-kick that gave Gills keeper Simon Royce no chance.
Simeon Jackson thought he had hauled the visitors level a minute later when he had the ball in the net but the effort was ruled out for a foul.
However, the Kent side got the point they deserved just before the hour mark when Karleigh Osborne brought tricky winger Andy Barcham down in the box and Jackson made no mistake from the spot.
Brentford’s Sam Wood went close with a volley just over the bar in the dying seconds, while Bees’ leading scorer Charlie MacDonald was stretchered off with a shoulder injury.
Billy Clarke had gone close for the Bees midway through the second half but his full-bloodied volley flashed agonisingly over.