Sean McConville missed an injury-time penalty as Stanley crashed out of the Johnstone’s Paint Trophy at the first hurdle.
McConville dusted himself down after being fouled in the 92nd minute and he could have taken the tie into a shoot-out against the League One side.
But the winger’s penalty was high and wide and it was Bury who secured a second round spot.
Stanley more than matched newly-promoted Bury in the early stages. Chances were at a premium with Andrew Tutte forcing a save out of Ross Etheridge on 15 minutes while McConville’s effort led to a decent save from Bury goalkeeper Rob Lainton on 22 minutes.
Stanley came the closest to breaking the deadlock in the first half on 41 minutes when, from McConville’s delivery, striker Adam Morgan, making his full Reds debut, had a header cleared off the line.
Accrington had not beaten Bury since January 2011 and it looked bleak when, a minute after the restart, striker Hallam Hope opened the scoring, getting on the end of a Craig Jones ball in.
Nathan Cameron came close to doubling the lead but was denied by Etheridge. However, Bury did on 72 minutes when Jacob Mellis set up midfielder Tutte, who found himself one-on-one with the goalkeeper and finished with composure.
Gerardo Bruno, who had come on for Piero Mingoia in the 70th minute, pulled a goal back for Stanley in the latter stages, as he slotted the ball past Lainton from inside the penalty area.
Stanley pressed and McConville was fouled in the area, dusted himself down but blasted well over from the spot.
Attendance: 1,344 (488 Bury fans)