Marcus Harness rescued a point for Portsmouth in a 2-2 draw at Accrington.
Ronan Curtis scored the opener for Pompey before in-form Harry Pell equalised and Matt Butcher gave the Reds a 77th-minute lead.
But Harness tapped home a cross from John Marquis after 86 minutes to share the points.
Stanley’s young keeper Toby Savin had to be in top form in the early stages, denying Harness, Marquis and Shaun Williams but Portsmouth finally found a way past him on 15 minutes.
After a swift passing move, Curtis got the ball in the area and drilled it low into the far corner of the net.
In a frantic match, Stanley levelled on 48 minutes. A Sean McConville corner was headed forward by Ross Sykes and Pell headed home.
Butcher cleared Curtis’ ball off the line with Savin stranded and, on 77 minutes, Butcher latched onto McConville’s through ball and lobbed Gavin Bazunu to put Stanley ahead.
Harness then fired home an important fifth goal of the season but Pompey have still won just once in 11 Sky Bet League One games.