Stanley couldn't make history by reaching the FA Cup Fifth Round for the first time as Martyn Waghorn scored a late winner for Derby in front of a record crowd.
5,397 fans packed into the Wham Stadium for the 12.30 kick off, breaking the record from Sunderland earlier in the season, with 2,659 County fans swelling the numbers.
However Dan Barlaser's dismissal on 59 minutes, for two yellow cards, made an already tricky task even more difficult against the Championship promotion-chasers and it was Waghorn who got the vital goal on 78 minutes.
County were also down to ten-men on 89 minutes when last man Jayden Bogle pulled down Stanley debutant Paul Smyth, who had signed from QPR the day before. However Billy Kee's free kick from the edge of the area was kept out by Kelle Roos and Stanley exited the cup.
The Reds came out to a sea of flags in the Clayton End and a ‘We spy a giant killing' flag.
On the pitch, Janoi Donacien made his second Stanley debut after joining on loan from Ipswich last week, the club he signed for in August.
Stanley certainly didn't look overawed but Barlaser was walking an early tightrope after his challenge on Liverpool loanee Harry Wilson earned him a yellow card in the opening minutes.
Jonny Maxted pulled off a superb low save to keep out a Waghorn header, the best chance of the half.
However, Stanley were passing the ball around well and a Sean McConville ball in evaded Kee with Jordan Clark unable to connect at the far post.
Callum Johnson fizzed the ball across the area which Clark just couldn't get a touch on at the far post while McConville tried to curl a strike into the top corner as Stanley looked to open the scoring.
At the other end, Derby's George Evans fired through a sea of bodies but Maxted dived low to keep out the effort.
Derby started the second half brightly, forcing the early pressure with Scott Malone playing in a ball across the box but Waghorn couldn't connect at the far post.
Mason Bennett fired another dangerous cross into the Stanley area but this time it was David Nugent who couldn't get a touch.
Stanley had a great chance on 58 minutes when McConville raced down the wing and played the ball in for Newcastle loanee Barlaser but his shot was blocked.
A minute later, the midfielder was sent for an early bath as he saw red for a second yellow card for a challenge on Nugent.
Despite being down to ten men, Donacien knocked the ball down to Kee one the edge of the area and his strike was inches from heading into the top corner of the net on 65 minutes.
And the ten-goal striker had a header minutes later which just went the wrong side of the post.
Derby got the all-important goal when a ball in pin-balled around the box and Waghorn forced home his sixth goal of the season.
New signing Smyth came on for his Stanley debut with seven minutes to go and did make a nuisance of himself, Bogle was dismissed but the Reds couldn't find the equaliser.