Rams skipper Michael Johnson grabbed the all-important goal just before the interval, but Stockport did create plenty of chances throughout the 90 minutes.
There was some early woe for Stockport when teenage midfielder Damien Allen was stretchered off after just nine minutes with a serious-looking leg injury.
The home side looked subdued, and soon after Derby midfielder Morten Bisgaard fired a sweet 20-yard strike inches wide of the post.
Adam Bolder then tried his luck, but Stockport goalkeeper James Spencer saved a well-struck volley at the second attempt.
The Hatters came agonisingly close on 23 minutes when Michael Rose whipped in a wicked cross from the left which the outstretched leg of Adam Proudlock missed by a whisker.
Ryan Smith was pulling Derby's strings though, and his threaded through-ball played in Bisgaard whose shot was well kept out by Spencer.
Stockport front-man Liam Dickinson fluffed a great opportunity to open the scoring when he blasted straight at Lee Camp, but as the first half drew to a close, the visitors finally got their deserved reward.
Just seconds after Giles Barnes had struck the Stockport post with a shot from outside the box, Ryan Smith's low drive was only parried by Spencer, with Johnson tapping home the rebound from close in.
Stockport created the first chance of the second period, with skipper Tony Dinning heading wide a deep corner from Rose. Makeshift striker Michael Raynes then headed a Rose cross over the bar.
Stockport had really upped the tempo, and on 65 minutes Keith Briggs raced through before driving a 20-yard effort inches wide.
Derby stemmed the tide as the clock ticked down though, and substitute Arturo Lupoli twisted and turned before shooting just over.
Mo Camara then found space on the edge of the Stockport box, but his shot was bravely blocked by centre-back Ashley Williams.
Dinning saw a late effort fly narrowly over, but Stockport couldn't quite fashion an equaliser.