The Hatters were beaten at The Racecourse Ground as Wrexham took advantage of the good fortune that came their way. Having gone in at the break a goal down, County dominated the second half but were denied a penalty on two occasions before Mark Cullen had a goal disallowed. Wrexham scored two late goals with Connor Jennings scoring a consolation header in added time.
Wrexham started the game brightly earning a corner in the first minute as Sean Newton deflected a cross from Danny Wright over his own bar. Wright's header from the corner was deflected wide for another corner from which Richard O'Donnell punched clear.
County's first attack saw Danny Hattersley denied by a finger tip save from Chris Maxwell, after neat interplay between Matt Mainwaring and Mark Cullen.
O'Donnell was back in action making a brave save at the feet of Wright, but was powerless as the home side took the lead, Joe Clarke slotting home from a cross in from the left.
Jon Nolan was booked for a strong challenge on Jay Harris, although the home crowd's reaction appeared to influence the referee's decision.
With both sides playing neat football on a wet surface there were several opportunities created, a free kick from Newton was cleared to Alex Kenyon who drove an effort over the bar from outside the box, who then cleared a header from Wright off his own line. The big striker then headed another corner kick wide.
Hattersley had the best chance of the half for County, his header from a Matt Mainwaring cross superbly saved by Maxwell, with the loose ball cleared for the Hatters first corner. County were denied a penalty as Newton's cross was handled in the box, Mainwaring firing over as referee Huxtable waved play on.
HT: Wrexham 1 Stockport County 0
The Hatters came out a different side in the second half, dominting possession and pushing for a leveller. Nolan's effort from the edge of the box well held by Maxwell, Newton then tested Maxwell with a vicious drive in from the left the keeper palming clear from under his bar.
On a rare break forward the home side should have made the game safe as Wright blazed over after weaving his way through Hatters defence.
Kenyon went down in the box under a challenge from two defenders with no penaly given, before Hattersley was clearly upended in the box, again no penalty given. Mark Cullen then had a goal disallowed for offside as he put the finishing touch to a goal bound header from Andy Halls.
As the Hatters luck had gone before, the home side made the game safe with two late goals, the first typical of the way the game had gone.
O'Donnell, appearing to have been blocked as the corner came across, punched the ball towards the edge of the box only for Wright to smash it back past him. The home side then broke down the right with substitute Ogleby slotting home to put his side 3-0, O'Donnell getting a hand to initial shot but unable to keep it out.
Connor Jennings finally managed to get his team on the scoresheet as he headed from Nolan's free kick in the first minute of added time
FT: Wrexham 3 Stockport County 1 (Jennings)
Starting XI: O'Donnell, Halls, Newton, Tunnicliffe, Kenyon, Hattersley (Macken), Cullen (Whitehead), Nolan, Fagbola, Mainwaring, Jennings.
Subs: Ormson, Connor, Whitehead, Meaney, Macken.
ATT: 4,206 (631)