Promotion chasing Crewe gave their hopes of clinching second spot a boost by recording their third successive win.
Rodney Jack's 15th goal of the season proved enough to Dario Gradi's an important home win which sent Stockport spiralling deeper into relegation trouble.
Crewe had looked likely winners after a bright start to the game during which shots rained in on the County goal.
Teenage striker Dean Ashton forced Ola Tidman into an excellent save in the seventh minute and 60 seconds later he fired a fierce drive inches wide.
Stefan Oakes and Kenny Lunt also went close as Crewe pushed for the breakthrough, but Stockport defended doggedly and the remainder of the half was a scrappy affair.
County almost hit Crewe on the counter attack just before the interval when top scorer Luke Beckett narrowly failed to convert an Ali Gibb cross.
Gibb continued to pose problems to the home defence after the restart but although County put several dangerous crosses into the Crewe box, goalkeeper Clayton Ince dealt with them in commanding fashion.
The visitors had employed an offside trap which caught Crewe out on half a dozen occasions in the first half but the plan backfired when Jack timed a run to perfection 14 minutes from the end.
He latched on to an Ashton through ball, raced forward 20 yards and slotted a composed finish past Tidman for the all-important goal.
Crewe could have added to their tally late in the game with Jack, Ashton and substitute Rob Hulse all going close.
Jack raced to the by-line but his cutback failed to pick out a team-mate, Ashton fired over the bar after working himself some space and Hulse had a powerful drive bravely blocked.
County threw men forward in the closing stages but Crewe held firm to register a vital victory in their promotion bid.