They had to come from behind after Shay McCartan pounced on a defensive error and rounded Bobby Olejnik to score.
Matt Oakley created Exeter's quickfire equaliser with a through ball that Tom Nicholls dispatched.
McCartan then struck a post, but the Grecians won it when substitute Christian Ribeiro bundled in a corner.
Promotion-chasing Stanley stayed sixth, while Exeter moved within five points of the play-off places in 13th.
Exeter City shrugged off their midweek FA Cup defeat by Liverpool to beat Accrington Stanley and record back-to-back League Two victories.