A strong, determined Coasters performance eventually produced the game's only goal, which arrived through Gerald McCullion after Charlie Markland let fly from distance and saw the strike deflect into the path of the forward, who hit a volley past Oli Riva and into the bottom corner.
The Young Coasters set the tone from the first minute when Patrick Johnrose put in a strong but clean challenge on Jake Young and later had the first real chance of the game.
Charlie Markland was set free down the right and managed to get the better of Brad Kelly to cut inside and aim for the top right corner, though his curling effort travelled inches over the bar.
Chances were falling the Coasters' way, and when Liam Muscart flashed a ball across goal and to Brett McGovern at the back post, he couldn't quite sort his feet out to put away the opportunity presented to him.
Just before the half-time interval, Patrick Johnrose tried his luck from distance but found Oli Riva's gloves before Charlie Hall produced a carbon copy of Johnrose's effort for Stanley moments before the whistle sounded.
Both teams continued to sound each other out following the restart, but the Coasters did almost take the lead when Charlie Markland crossed towards Ben Lappin at the back post, with the ball evading him as he was about to pull the trigger.
It was the Coasters who took full advantage of being on top when Markland picked the ball up from his own half, drove at the Accrington defence and let fly from the edge of the area. The effort deflected off a Stanley shirt and into the path of Gerald McCullion for a volley at goal and into the bottom corner.
Accrington pushed late and almost levelled through captain Josh Smith. He met a cross from the right but headed onto the roof of the net as Conrad Prendergast's side progressed into the Third Round of the competition.