Martin Allen's side looked in for an easy ride when they took the lead after just three minutes. Nathan Pond gifted the ball to Callum Davies who set up Danny Kedwell to apply an expert finish for his 14th goal of the campaign.
But Fleetwood refused to roll over and equalised just after the half-hour mark. Junior Brown's cross was headed against the crossbar by Gareth Evans but Matt was perfectly placed to nod home the follow up.
The Gills regained the lead before the break, Charlie Allen with a free header past Scott Davies in the home goal.
Fleetwood were far from buried and pulled level again with just over 20 minutes remaining. Brown forced his way through a crowded area and Matt got the final touch.
The hosts pressed for a winner, with Evans, Matt and Barry Nicholson all going close.
And Kedwell could have snatched a late victory for Gillingham but his header from Charlie Allen's free-kick was turned around the post by Davies.