Captain Rosaire Longelo scored a wonder goal in the last minute of added time to set up a last 16 tie with League One Bolton Wanderers in the Bristol Street Motor’s Trophy.
Just as it looked like the game against League One Lincoln was heading to penalties, Longelo raced down the right and unleashed a fierce 20-yard drive which nestled into the back of the net in front of the Clayton End.
It set up a clash at the Wham Stadium with Bolton in January.
Alex Henderson made his first start for Stanley while there was a welcome return to the squad for Joe Pritchard, who was on the bench.
Former Reds Lukas Jensen and Ethan Hamilton lined up for the League One Imps.
Stanley forced the early pace and had a great chance on seven minutes when Jack Nolan’s ball found Josh Woods in the six-yard box but he couldn’t get enough power behind his shot and hit it straight at Jensen.
The Reds were bossing possession and chances with Connor O’Brien and Longelo linking up well on the right and playing a number of dangerous balls into the box.
Lincoln struggled to test Reds loan keeper Joe Walsh, who was playing his second game for Stanley after arriving on an emergency loan from QPR.
Just before half-time Ben Woods tried his luck from 25-yards, forcing a diving save out of Jensen.
After the restart, Jensen had to be alert to keep out Longelo’s long range strike and then a Ben Woods blast was touched over the crossbar by the finger tips of the Imps keeper.
Jensen got down low to keep out a Brad Hills header as it was all Stanley as they pressed for the opening goal.
However Lincoln had the next big chance on the hour mark with Teddy Bishop getting the ball in the area with just Walsh to beat but the loan keeper did well to deny him.
The visitors then had a goal ruled out for off-side on 62 minutes and, minutes later, Nolan thought he had opened the scoring but he too was judged off-side after a neat finish.
Pritchard returned to action on 70 minutes, replacing Henderson.
Josh Woods headed straight into Jensen’s arms while at the other end Walsh’s quick reactions denied Jovon Makama a certain goal as both sides looked to break the deadlock.
Jensen held onto another Josh Woods effort on 75 minutes while Walsh produced a superb one-handed save to keep out a curling strike from ex-Red Hamilton on 81 minutes.
Nolan fired narrowly over the bar in the 88th minute before the last minute heroics from Longelo.
Stanley: Walsh, Shipley, Hills, Gubbins, O’Brien, Nolan, B Woods, Martin, Longelo, Henderson (Pritchard), J Woods.
Subs: McIntyre, Pritchard, Patrick, Pickles, Adekoya, Trickett, Devonport
Yellow: Henderson, B Woods
Crowd: 1159 (194 from Lincoln)