Defender Ross Sykes scored the winner in injury time as Stanley progressed to the knock-out stages of the Checkatrade Trophy.
The Reds needed to win to finish in the top two in their group and Sykes headed home the winner against West Brom U21s to prevent the tie going to penalties.
It's Stanley second victory in the competition – beating Macclesfield in their first game – with a trip to Blackpool next Tuesday in their final group game.
Stanley bossed the chances in the first half with Sean McConville denied by keeper Jonathan Bond early on and Connor Hall did have the ball in the back of the net on 12 minutes but it was ruled off-side.
McConville tested Bond again with a 20-yard free kick while West Brom U21s defender George Harmon cleared Newcastle loanee Luke Charman's header off the line and, from the corner, Matt Platt's long range strike was deflected just wide.
The Baggies did press the Stanley defence with a couple of corners and almost grabbed the opener on 38 minutes from a firm strike from Nick Clayton-Phillips which was deflected inches wide of the post.
At the other end, Charman's 20 yard strike was deflected just wide, a McConville effort whistled just over the bar and the winger wasn't far off with the final shot of the half but it remained goalless at the break.
Jordan Clark opened the scoring for Stanley on 49 minutes, Charman back heeling the ball to the winger who made space for himself and fired low into the far corner of the net.
Keeper Jonny Maxted was in action immediately after, doing well to keep out a shot from Finn Azaz to stop West Brom U21s drawing level.
However, West Brom 21s did equalise on 62 minutes with Jonathan Leko bundling the ball over the line at the far post from a Clayton-Phillips cross.
Stanley looked for the winner with Scott Brown firing into the side netting while Hall, clean through, was denied by Bond.
Charman also blasted over in a good position and it needed a last-ditch save from Bond to keep out Hall's effort in injury-time but, from the resulting corner, Sykes headed home the winner.