Simon King's first-half blunder handed Lee Sinnott his first league win as Vale boss and moved his side off the foot of the table.
King put through his own net moments before half-time after Calum Willock had cancelled out Chris Dickson's opener a minute after falling behind.
With the game played in appalling weather, Gillingham's Adam Miller looked to make the most of the conditions early on with a low, skidding free-kick in the 17th minute, but his effort fizzed just wide.
At the other end, Marc Laird's fierce drive brought a superb block out of Gillingham's veteran goalkeeper Simon Royce.
But the game finally came to life in the 32nd minute when Dickson latched onto Miller's fine through-ball before calmly tucking his effort past Joe Anyon into the far corner.
Gillingham's lead would last barely a minute, however, as David McGoldrick's cross caught the home defence napping, allowing Willock to head home from three yards out.
McGoldrick then stunned the hosts on the stroke of half-time by waltzing unchallenged into the area before sliding a low effort towards goal that defender King could only help on its way over the line.
Vale continued to press forward after the break rather than protect their lead as the home side struggled to get a foothold in the game.
Luke Rodgers continued to pose a threat with his intelligent runs across the Gillingham line and went close with a couple of volleyed half-chances.
The Gills came agonisingly close to an equaliser when Miller rose highest to meet Sean Clohessy's 76th minute cross but directed his header inches wide of Anyon's far post.
As the clock ticked down, Dickson saw his drive smartly turned away by Anyon only to fire an even better chance wide of the target from Stuart Thurgood's pass to seal Mark Stimson's first home defeat as Gillingham manager.