The Gills came from behind to extend their superb away record, having now not lost on their travels since October, with goalscorer Bradley Dack and half-time substitute Charlie Allen earning particular praise.
Gillingham's lead at the top of the table was cut from five to four points but they still boast a game in hand over their rivals, who now have just seven matches to close the gap.
After seeing Dack level the scores with his first-ever Football League goal, Allen said: "Bradley has been on the radar for a long time.
"He scored 27 goals in the youth team last year and five goals for us in pre-season and I think I perhaps should have used him more this season.
"Having said that I was going to rest him here because I wondered if three games in a week was going to be too much. But he scored some great goals in training on Friday and looked really sharp and that made my mind up.
"He has a great engine, really looks after himself and gets into great positions and I thought he and Charlie Allen were excellent for us.
"The pace and running ability they have is priceless and their power told in the second half, I think if anyone deserved to win it was us. They had a lot of the ball but didn't really hurt us."