Gills defender Ian Cox was sent off in first-half injury-time for his second bookable offence, but Ronnie Jepson's men defended stoutly for the second period and Cheltenham lacked the spark or invention to open them up.
There were plenty of chances during an open, entertaining first half and it was the visitors who took the lead with a sixth minute goal.
Highly-rated wide player Matthew Jarvis darted down the left leaving full-back Jerry Gill behind him. Jarvis got to the byline and pulled a low cross back for Bas Savage to tap in his first goal of the season.
Before that Cheltenham goalkeeper Shane Higgs had already made a spectacular save from Jarvis and he made an even more impressive stop from Michael Flynn shortly afterwards.
Cheltenham had started slowly but they hauled themselves level on 17 minutes when Cox halted a solo run from Scott Brown to earn his first booking of the match.
Melligan blasted the resulting free-kick from 20 yards past the defensive wall and inside goalkeeper Dean Brill's left-hand post.
Brown almost put the Robins in front when he volleyed straight at Brill from a Gill cross but Higgs had to be at his best again to save from a Gary Mulligan volley just before the break.
Cheltenham were handed their man advantage during first-half injury-time when Cox, who had already been booked then spoken to at length by referee Tony Bates for a foul on Kayode Odejayi, was shown a second yellow card for grappling Cheltenham's Nigerian frontman to the ground.
After the break the tide was flowing mostly towards the Gillingham goal but the visitors, with defender Leon Johnson on to replace Cox with Savage making way, held firm.
Cheltenham kept plugging away but on the few occasions they were able to get past the defence Brill was there to deny them.
The on-loan goalkeeper saved a 20-yard drive from John Finnigan and a looping header from Paul Connor before touching over a firm shot from John Melligan.