Goals from Ash Palmer and Sam Minihan gave Stockport the win, with both goals coming from set pieces.
Leighton McIntosh gave Wrexham a consolation goal at the end, scoring into an open net from a long, tight angle.
Luke Summerfield and Ben Tollitt both had glorious efforts, but they only troubled the goal’s woodwork in the end.
Bryan Hughes made five changes to his team after the 4-2 defeat away to Hartlepool, in order to freshen up the side.
Jason Oswell replaced an injured JJ Hooper to face his old team in Stockport and make his first start of the season.
Wrexham started the game six places below Stockport, in 13th, and nine points off Woking at the top of the table.
An early injury to Jake Kirby in the second minute saw him substituted for Alex Curran just five minutes in.
The opening ten minutes was unarguably scrappy between the two sides, with the home and away fans offering the most entertainment.
Bobby Grant was the first Red to test the Hatters’ keeper, with a twenty yard strike bending just wide in the 11th.
After a cry of handball in the Hatters’ penalty area, Sam Walker was brought down in the 17th after a strong challenge from Luke Young on the halfway line.
Elliot Osbourne whipped in a seemingly harmless ball for Wrexham keeper Christian Dibble to catch, but the ball wouldn’t stick in his grasp, leaving Palmer to nod home from close range, with Dibble failing to scramble it clear with twenty minutes on the clock.
The Stockport goal seemed to give Wrexham the wake-up call that they needed, as Young’s venomous strike was deflected just wide in the 21st.
Michael Chambers was finally able to assert his dominant height off a Young corner, with his header drifting just over the bar in the 26th.
After some clever play between Devonte Redmond and Young, Summerfield attempted a half volley slice from the edge of the box to cries of ‘Don’t shoot!’, however his shot thundered against the post, leaving Ben Hinchcliffe rooted to his spot. The 27th minute also brought about a bicycle kick from Oswell, but this caused no harm to the Stockport keeper.
The 34th brought about some clever play by Mark Harris to drive and set up Redmond for a long ranged effort, but his shot was driven straight at Hinchcliffe.
Stockport came at the Wrexham backline minutes later, as Adam Thomas’ neat run and shot was saved by a diving Dibble, with Young being on hand to clear away.
Chambers being nutmegged led to him bringing down Nyal Bell on the edge of the Wrexham box. Walker’s inventive free kick allowed Palmer to nod the ball back into the six yard box. After a smart save by Dibble and multiple goal-line blocks, Minihan struck the ball into the Wrexham net to give the visitors a two goal lead in the 39th.
The second minute of added time led to a second Wrexham bicycle kick from Grant, but his shot in tight space was easily blocked by the Stockport defenders.
Wrexham ended a poor first half with successive corners, which only resulted in a Shaun Pearson header sailing over.
Chambers was causing a nuisance in the Stockport penalty area five minutes into the second half, as his strong hold up play allowed him some room, but his shot was dragged just wide.
Summerfield was starting to grab the game by the neck, as his driving run down the wing resulted in a beautiful clip over the keeper’s head into the path of Grant outside the post, whose tap-in was somehow cleared by Jordan Keane on the 53rd minute mark.
Jazzi Barnum-Bobb splits the Stockport defence, with a ball into Oswell, whose shot was smartly blocked on the hour mark.
Summerfield was showing great perseverance in the 62nd, as he fought to win back the ball on the halfway line, then link with Oswell to have a shot from far out, which was fumbled by Hinchcliffe to no danger.
The Reds made their first substitution 65 minutes in, as Leighton McIntosh replaced a struggling Redmond.
Confusion at the back in the 70th minute allowed Minihan to pull the ball back for Thomas in the Wrexham penalty area, but his shot blazed over the crossbar.
With 15 minutes left on the clock, Wrexham started to assert more pressure on the Stockport defence, by spreading it wide and crossing hopefully.
Harris’ clever ball on the angle put through Grant in the 81st, who tried to place it in the corner, but Hinchcliffe parried it away.
Tollitt attempted yet another long range effort for Wrexham, and his powerful shot was tipped onto the crossbar by Hinchcliffe in the 83rd.
A minute later and McIntosh found Wrexham a goal. He took it wide past Hinchcliffe on the edge of the box and passed it onto the post and in, from an impossible angle and distance.
Grant fired over in the 90th minute, followed by a cross which looped over Hinchcliffe’s head and was heading for the top corner, but he parried it away for a corner.
Stockport turned defence into attack and Thomas’ shot was cleared off the line from close by Barnum-Bobb.
After some tough pressure, the away side came away from the Racecourse with all three points.
Wrexham AFC: (4-2-3-1): Dibble (GK), Barnum-Bobb, Chambers, Pearson ©, Carrington, Summerfield, Young, Redmond (McIntosh 65’), Grant, Oswell (Tollitt 71’), Harris
Subs not used: Szczepaniak (GK), Barton, Wright
Stockport County FC: (4-2-3-1): Hinchcliffe (GK), Minihan, Palmer, Keane, Cowan, Turnbull (Mulhern 80’), Walker, Osborne, Thomas, Kirby (Curran 5’), Bell (Arthur 66’)
Subs not used: Ormson (GK), Jackson
Referee: Gary Parson