Super-sub Ash Hunter’s superb close-range volley gave Fleetwood Town all three points at Highbury.
Town took an early lead as David Ball diverted Kyle Dempsey’s strike home in the 19th minute but Gillingham hit back in the 52nd minute as Deji Hessenthaler fired the ball into the bottom corner.
But Hunter clinched the three points as he volleyed in Conor McLaughlin’s right wing cross in the 82nd minute.
The first half was as dull as the grey skies above Highbury with only Kyle Dempsey’s moment of magic lighting up the pitch.
Grant fired way wide on a couple of occasions but live-wire Dempsey took the game by the scruff of the neck in the 19th minute as he carved through Gillingham and looked to be rifling in his first goal for Town before poacher Ball got a foot to his on target effort and helped it over the line.
The half ended in controversy after Ball was flattened by Chris Herd on the half-way line. The centre half looked to have used his elbow as he went up for an aerial challenge with Ball with the striker tumbling to the ground in pain but referee Richard Clark only deemed the foul as a bookable offence much to the disgust of the home faithful.
Just seconds after Chris Long’s cross fizzed across the six-yard box the Gills equalised early in the second half.
Once again Town failed to fully clear the danger from a set-piece as Ball nodded a corner straight out to the waiting Hessenthaler who was hovering unmarked just outside the box. The midfielder tried his luck from distance and his speculative, low effort just crept into the bottom left corner despite Town keeper Chris Neal getting a hefty palm to the ball in the 52nd minute.
The goal brought the physical Gills side back to life but it was Town who looked more of a potent threat on the attack even with Ball and Ryan tripping over one another as they wasted a chance just outside the box.
Long raced into space on the left hand side of the box but his angled strike was just tipped a whisker wide of the right post by Stuart Nelson’s fingertips.
Ryan orchastrated a slick counter-attack as he sprinted out of his own half from a Gillingham corner but he over hit his final pass to Hunter who was overlapping on the left as they stormed towards the opposition goal.
Ryan pulled up after playing that pass but after receiving some treatment on the pitch he was able to shake off the knock.
The lively Hunter was unleashed on the left, he cut inside and his curling shot just dropped over the bar as Town searched for an equaliser.
Super-sub Hunter popped up with yet another goal off the bench as he volleyed in McLaughlin’s right wing cross after Nirennold and the full-back had won the ball back on the wing.
But Town had a late scare as Frank Nouble found room on the left of the box but his angled effort just whizzed past the right post.
Town stood strong in the five minutes of extra time to seal another three points to move up to 10th in the League One table.
Fleetwood: Neal, McLaughlin, Pond, Bolger, Bell, Sowerby (Nirennold, 54), Dempsey, Ryan, Grant, Long (Hunter, 68) Ball (Cole, 77). Subs not used: Cairns, Jonsson, Eastham, Woolford.
Gillingham: Nelson, Herd (Pask, 81), Ehmer, Oshilaja, Hessenthaler, McDonald (Donnelly, 89), Knott, Koncheskey, Wright, Nouble (List, 89), Emmanuel-Thomas. Subs not used: Hadler, Osadebe, Oldaker, Byrne.