Hughes claimed the winning goal on his Vale debut, although the final touch following a goalmouth scramble may have gone in off Gills defender Adam Barrett.
Hughes' strike partner Tom Pope had given the Valiants a fourth-minute lead, heading past Stuart Nelson following a pin-point Adam Yates cross for his 24th league goal of the season.
Danny Kedwell pulled one back for the hosts less than 60 seconds after Hughes' 20th-minute finish.
It was Gillingham who had the better of the chances despite trailing at the break, with Chris Neal saving from Myles Weston and Kedwell's near-post flick almost crossing the line.
In the second half Pope and Hughes, signed from Notts County this week, showed good signs of an understanding as each teed up the other for efforts at goal.
As the hosts chased an equaliser in vain, Neal saved brilliantly from Charlie Lee's header while Weston fired over.