A last-minute strike from Rosaire Longelo saw City exit the Bristol Street Motors Trophy.
Stanley almost took a 7th minute lead when a recycled corner found Josh Woods in the box, but Lukas Jensen spread himself well to deny the forward.
City’s first shot came when a long throw bounced around in the penalty area before a half-clearance set Ethan Hamilton up on the edge of the box, but his effort went over.
Alex Henderson looked to get in behind the Imps’ defence in the 22nd minute but Jensen came out bravely to meet him and deny the teenager a clear sight of goal.
The Imps then swung a free-kick into the box which Ben Woods nearly headed into his own net, but his attempted clearance dropped just wide.
Shodipo continued to cause problems down the right-hand side, and after playing Lasse Sorensen down the wing, the Dane struck a powerful effort off-target.
Ben Woods came close to giving the hosts a half-time lead as he curled towards the top left corner, but Jensen parried the ball away to safety.
Alex Mitchell headed over the crossbar from Danny Mandroiu’s corner to bring an end to the first-half action.
After the break Rosaire Longelo took aim from 20 yards, forcing Jensen into a finger-tip save down to his left.
The Dane was on hand again minutes later to hold onto Brad Hills’ header from a corner.
On the hour mark City intercepted a pass out from the back leading to Sorensen feeding Bishop in the middle, but the midfielder’s shot was smothered by Joe Walsh.
The Imps thought they had taken the lead when Mandroiu finished off Bishop’s cut-back but the linesman’s flag denied the Irishman.
Accrington then had a goal of their own disallowed when Jack Nolan’s finish was ruled out for offside.
In the 74th minute Walsh made a superb save to deny Jovon Makama from close-range after quick City play had resulted in Sorensen crossing in for the substitute.
The second half was proving to be a much livelier affair and it was Stanley’s turn to attack as Longelo escaped down the left.
After sending a low cross towards Josh Woods the midfielder directed a shot into the hands of Jensen.
On the counter-attack City almost found the winner when Hamilton curled a shot from outside the box, but he was denied by a fantastic save from the Accrington shot-stopper.
In the final minute of the game Stanley broke the deadlock through an superb curling strike from Longelo.
Accrington: Joe Walsh, Lewis Shipley, Brad Hills, Ben Woods, Rosier Longelo, Joe Gubbins, Jack Nolan, Dan Martin, Alex Henderson (Joe Pritchard 70’), Connor O’Brien, Josh Woods. Subs (not used): Jack McIntyre, Oliver Patrick, Aaron Pickles, Leslie Adekoya, Lewis Trickett, Owen Devonport.
Goal: Longelo (90+3’)
Imps: Lukas Jensen, Lasse Sorensen, Ethan Erhahon, Erhan Hamilton, Danny Mandroiu (Dylan Duffy 68’), Paudie O’Connor, TJ Eyoma (Hakeeb Adelakun 90+2’), Sean Roughan, Alex Mitchell, Jack Vale (Ted Bishop 58’), Olamide Shodipo (Jovon Makama 58’). Subs (not used): Jordan Wright, Adam Jackson, Jack Burroughs.
Referee: Martin Woods
Attendance: 1,159