Goals from Simeon Jackson and substitute Mark McCammon sent the home side on their way to victory.
And the win was sealed in the dying moments with a fabulous free-kick from on-loan star Charlie Daniels.
Grimsby had set themselves up in a 5-3-2 formation and it was they who looked the better side early on with Peter Till testing Simon Royce with a powerful long-range drive on 24 minutes that the keeper managed to push away.
Minutes later Gillingham's Simeon Jackson's volley produced a save of similar quality from Royce's opposite number, Phil Barnes, as the game began to spark into life.
But the former Blackpool stopper was unable to prevent Gillingham's opener in 35th minute when Dennis Oli rose to meet John Nutter's corner with a near-post flick that deflected off Jackson on the line.
The home side's lead was almost wiped out shortly into the second half when Till cut in from the left, danced his way past a couple of defenders before shooting rather tamely at Royce.
The Mariners were beginning to find some rhythm but were left cursing their luck in the 62nd minute when substitute Danny North lobbed Royce with a wonderful volley from 35 yards, only to see his effort rebound off the underside of the bar.
Gillingham's lead looked increasingly fragile but with 20 minutes remaining substitute McCammon killed off the Town revival with a well-taken goal.
Grimsby failed to deal with Simon King's long ball forward and after Barnes saved McCammon's initial strike, the Barbadian coolly sidefooted the rebound into the corner.
That knocked the stuffing out of the visitors but they could only stand and admire as Daniels stepped up and bent an exquisite free-kick into the top corner with a minute remaining.