Two neat finishes from leading scorer Cody McDonald, which took his tally for the season to 14 earned the Gills the points from a scrappy battle.
A fine finish from Shots debutant Alex Rodman deep into time added on thankfully came too late to cause too many jitters at the end.
The victory see's the Gills rise two places in the League Two table to seventh and once again hold the final play-off position, but they are now level on points with both fifth and sixth placed Bury and Port Vale.
There was one enforced change to the starting line-up with Luke Rooney coming into the side for Danny Spiller (broken finger). He began the game on the right-side of midfield but he and Curtis Weston continued to swap throughout their time on the pitch.
There was not quite a minute on the clock when Aldershot created the first opening, Peter Vincenti broke down the left before forcing Alan Julien to turn a decent shot round his near post.
The Gills started to press forward and the game was played mostly in the Aldershot half. The visiting defence conceded a couple of dangerous free-kicks with Rooney hitting the wall with one before Danny Jackman curled the second inches wide of Jamie Young's left-hand post.
There was crunching challenge between both Luke Guttridge and Kevin Maher in the 14th minute, and it was worrying for a few moments as the Gills midfielder was left prone on the turf . Thankfully the threat of a cold spray on an already chilly afternoon soon saw him up and about.
There weren't too many chances throughout the remainder of the half as both teams gave the ball away too cheaply when they won possession.
The busiest man as the half wore on was referee Phil Gibbs who booked both Danny Hylton and Anthony Charles. Hylton had clashed with Barry Fuller while Charles fouled McDonald.
H/T: 0 - 0
Another Gills player, Matt Lawrence, required a period of treatment in the opening stages of the second period while the Shots were forced into their first change, introducing Alex Rodman for his debut, replacing Wade Small.
Rather out of the blue, the Gills took the lead in the 53rd minute. Weston's cross from the right was somehow missed by Charles which allowed McDonald his first sniff of goal for the afternoon and the striker gave Young no chance as he drilled the ball home from just inside the area.
John Nutter then went into the referee's notebook in the 54th minute after clattering former Merstham winger Jermaine McGlashan.
Both Rooney and Weston broke into the area down the left flank but both failed to find team-mates with their attempted cutbacks.
Jack Payne replaced Weston in the 62nd minute and took over a central midfield role with Jackman moving to the left.
Rooney, making his first start of the season, went down with cramp in the 65th minute and was replaced two minutes later by Mark Bentley. At the same time Tim Sills took the place of Vincenti up front for the Shots.
The Gills survived a major scare in the 73rd minute, Hylton got free down the left and fired a low shot beyond Julian but the lunging McGlashan somehow managed to prod the ball the wrong side of the far post from close range.
Gillingham's final change saw Joe Martin
replace Jackman and at the same time the Shots withdrew Jamie Vincent and put on Anthony Straker.
McDonald then had two efforts in quick succession, the first an an attempted lob found the back-pedalling keeper who then smothered a low angled strike.
The Gills were almost made to pay for not being able to kill the visitors off in the 89th minute. A Rodman corner was powered goalwards by the head of Ben Harding but Julian was thankfully able to parry and the ball was cleared.
Straight away the Gills attacked and added a second. Skipper Fuller crossed from the right and McDonald, taking advantage of a bounce off Ben Herd, took the ball down before hammering a shot past Young.
Dean Holdsworth, who hadn't tasted defeat in his three previous games as Shots boss, saw his side continue to press forward and twice Kevin Maher was in the right place to effect clearances but six minutes into time added on, no-one was able to get close as Aldershot did pull one back.
Winger Rodman, signed this week from Tamworth, cut inside from the left before thumping a low, rasping 25-yarder beyond Julian. It was a tremendous strike.
Thankfully there was no time for the Shots to do anything once the Gills re-started as referee Gibbs blew the final whistle, much to the delight of most of the 4810 inside Priestfield.
Julian, Fuller, Gowling, Lawrence, Nutter, Rooney (Bentley 67), Weston (J.Payne 62), Maher, Jackman (Martin 78), McDonald, Akinfenwa
Unused subs: Cronin, Richards, S.Payne, Miller
Young, Vincent (Straker 79), Herd, Charles, Vincenti (Sills 67), Jones, Guttridge, Harding, Small (Rodman 49), McGlashan, Hylton
Unused subs: Panther, Grand, Morris, Clement
Attendance: 4810 (Shots 352)
Referee: Phil Gibbs
Assistants: Gary Evetts and Rob Whitton
Fourth Official: Darren Blunden