Winger Elliott Bennett hit his first goal for Albion and made the other as the Seagulls claimed victory over their former landlords.
Bennett put Brighton on their way with a brilliant strike direct from a free-kick after being brought down on the edge of the area by Adam Miller in the 24th minute.
The former Wolves steered his effort over the wall and into the top corner off the underside of the bar.
Veteran Gillingham keeper Simon Royce saved brilliantly from midfielder Andrew Crofts and also thwarted striker Liam Dickinson as Brighton threatened in the second half.
Josh Gowling put a free header over for Gillingham before defender Tommy Elphick made the points safe by firmly heading a Bennett cross home 12 minutes from time.
Brighton were good value for only their second home win of the season and climb out of the relegation zone, while Gillingham have now lost five out of six on their travels.