Substitute Macauley Bonne fired the winner as Gillingham closed in on the play-off places with a 2-1 victory over fellow promotion hopefuls Accrington.
Teenager Alex Henderson gave Stanley a first-half lead but two goals after the break sealed Gills the three points.
The first half was largely forgettable. The best chance fell to Accrington, with Gillingham goalkeeper Jake Turner pushing out Ben Woods’ long-range effort and Josh Woods sending the follow-up into Turner’s arms.
The home side opened the scoring after 50 minutes when a Jack Nolan free-kick found Henderson, on his full League debut, and he headed home his second goal in as many games.
Gillingham’s equaliser came in the 62nd minute when Connor Mahoney’s corner was headed back across at the far post and Conor Masterson nodded in from almost on the goal-line.
Gills scored the winner after 75 minutes with former Stanley player Mahoney involved again. He sent in a cross which Tom Nichols played into the path of substitute Bonne and he rifled the ball into the roof of the net.