Max Clark blasted home a stoppage-time equaliser to rescue a point for Gillingham in their draw with fellow strugglers Accrington.
It looked like Benn Ward's first Football League goal would be enough to secure a victory for Stanley, who were looking for back-to-back wins.
But Armani Little's short free-kick was lashed home by Clark to seal a point for Gillingham boss John Coleman on his return to the Wham Stadium, where he managed for more than 20 years in two spells before he was sacked in March.
It was a competitive opening with Gills keeper Glenn Morris producing a superb double save on 22 minutes, keeping out Jake Batty's fierce drive and a Ben Woods strike.
While Gillingham pressed around the Stanley box, the Reds continued to create the better chances with Kelsey Mooney unable to hit the target from close range.
Stanley broke the deadlock in the third minute of added time when a Woods free-kick from the left was fired home by the inrushing Ward.
Gillingham pressed after the break but still struggled to trouble Stanley keeper Billy Crellin until Clark's late heroics – their only shot on target in the game.
Report supplied by PA Media.