Wrexham AFC Youth's unbeaten league run came to an end this afternoon after a late County goal took three points at Colliers Park.
Dan Nolan's side went a goal down in the first half via a Josh Osifo header before the lead was doubled by Liam Watson.
Wrexham hit back with two goals in quick succesion via Tom Jenkins and Kai Evans but Nathan McFarlane's finish with five to play secured a Hatters win.
Wrexham made a few changeds to the side that ran out 4-1 winners over AFC Fylde a week ago as Reece Oliver, Jacob Milner and Jake Towse came in for the absent Ollie Hitchcox and substitutes Harry Bell and Owen Cushion.
Goalkeeper Matty Hess made the bench for the first time whilst Dan Davies also returned.
In an even encounter, both sides pressed without truly testing the goalkeepers. Louis Parr had a couple of tame shots easily caught whilst Milner forced a corner on 12 minutes which came to nothing.
Wrexham's best chance came on 25 minutes as Kai Evans won a corner. He took the set-piece himself which met the onrushing head of Jenkins, but he couldn't direct it on target when unmarked in the box.
On the half hour mark Stockport came close as a corner came in, blocked by Oliver before Osifo blazed wide from close range. However, he wouldn't make the same mistake twice.
Osifo was on hand to meet a cross from the left a minute later to head Stockport in front.
Just before half-time it could have been two had it not been for some heroics from Parr to tip a close range effort on to the post.
Half-Time: Wrexham 0-1 Stockport County
With just 24 hours since Nolan's side faced a young Manchester City side, he opted to make a switch at half-time with Rowan Davies being replaced by Dan Davies.
Wrexham improved in the second half and began floodling forward, causing trouble down both flanks.
Evans raced down the left before striking the ball into the side netting, whilst Stockport broke and forced Parr into a smart stop.
On 67 minutes Wrexham had a free-kick 35-yards out, Evans hit a sweet knuckleball at goal crashing against the bar, and the follow up was cleared.
Stockport, not as rattled as the crossbar moments earlier, would eventually double the lead. A long ball over the top was misjudged by Parr and Watson was able to tuck away.
The frantic pace of the game picked up with twenty minutes to go, as Wrexham halved the defecit via Jenkins who hit the ball on the turn 12-yards out. Seconds later, Evans nicked the ball from a defender, pushed his way through and finished well to level.
On 82 minutes Evans almost had a second after a long ball forward was brought down on his toes before being forced wide in the box, he scirted around the box before shooting wide.
With five to go, Wrexham came undone by another long ball. It fell to McFarlane who sent the ball past Parr to grab the winner.
Wrexham would have a succesion of corners in stoppage time, but couldn't profit and now lose their unbeaten league run.
Wrexham Line-Up: Parr, Milner, Oliver, James, R.Davies, Fountain, Jenkins (c), Mountfield, Evans, Jones, Towse.
Subs: Hess, Cushion, Bell, Simpson, D.Davies.
Referee: Jamie Monk
Man of the Match: Kai Evans