Tanto Olaofe scored a hat-trick as Wrexham’s winning streak was halted by a clinical Stockport County side at Edgeley Park.
There had been little in the game until Olaofe broke the deadlock, but Stockport seized control as the striker pounced on a defensive mistake to double the lead and Louie Barry added a third.
Olaofe completed his hat-trick after the break and though Wrexham then twice hit the crossbar, Paddy Madden’s late strike sealed the visitors’ heaviest defeat under manager Phil Parkinson.
Wrexham, playing in the white away shirts for the first time this season, made just one change from the win at home to Grimsby last weekend – Sam Dalby starting ahead of Ollie Palmer.
Luke Young got the game underway and within a minute Ben Tozer had the chance to test the Stockport defence with a long throw-in. Two unconvincing clearances eventually led to the ball dropping to Elliot Lee, but he sliced his shot wide.
Lee was in again on five minutes, playing a clever one-two with Paul Mullin after Tom O’Connor’s probing pass, and opening up onto his left foot, but his low shot was too close to Ben Hinchliffe.
Four minutes later, Dalby got to another Tozer throw between two defenders at the near post but, slightly unsighted, headed well off target.
Stockport were in front on 21 minutes, however, as Will Collar ran onto Ben Hinchliffe’s ball over the top and crossed low from the right-wing for Olaofe to finish from close-range.
Olaofe should have had another on 27 minutes, ghosting in unmarked to head a left-wing cross goalwards, but with Howard stranded the ball hit the foot of the post. Antoni Sarcevic kept the ball alive and crossed for Odin Bailey, but Will Boyle read it well and cleared off the line.
Wrexham were masters of their own downfall on the half-hour, however, when Tozer misread Boyle’s backpass, which allowed Olaofe in to turn him and finish coolly from close-range.
And things went from bad to worse just two minutes later, when Louie Barry strode far too easily through the middle of the pitch to fire in Stockport’s third.
Shellshocked Wrexham struggled to conjure up a response, with Hinchliffe having little to do through to half-time.
Stockport added a fourth just five minutes after the restart, however, when Barry’s left-wing cross deflected kindly for Olaofe to head in at the back post and complete his hat-trick.
Luke Young found space for a rising, long-range shot on 53 minutes which Hinchliffe turned over.
Boyle then had a chance to pull a goal back on 61 minutes, after Hinchliffe could only half-clear from Tozer’s cross, but the defender shot high and wide.
Wrexham grew into the half, despite the deficit, and Dalby found McClean on 63 minutes, but the Irishman’s shot was beaten clear by Hinchliffe.
From the resultant corner, Mullin went even closer – his header was deflected up onto the cross bar and Lee shot wide across goal from the rebound.
Wrexham made a triple substitution on 64 minutes, with George Evans, Ollie Palmer and Steven Fletcher on for Boyle, Mullin and Dalby.
And on 70 minutes, after Fletcher was fouled on the edge of the box, George Evans was unable to beat the wall from the subsequent free-kick.
Lee was inches away from what would have been the goal of the game on 73 minutes – his rising shot from outside the area clattering the crossbar and bouncing clear.
Ethan Pye’s injury, after block Ollie Palmer’s cross, took the sting out of Wrexham’s resurgence however.
There was still time for Tom O’Connor to twice fire goalwards, after George Evans received a short corner and crossed.
But Stockport substitute Madden wrapped up the scoring in the final minute when he was left unmarked to fire in from close-range.
It meant Wrexham suffered just their second defeat of the season, but their heaviest since losing by the same scoreline to Luton Town in February 2014, with the Red
Stockport County: (4-2-3-1): Hinchliffe, Southam-Hales, Pye (Pond 79), Horsfall, Touray, Croasdale, Bailey (Wright 71), Collar, Sarcevic (Cotterill 90+4), Barry (Richardson 90+4), Olaofe (Madden 79)
Subs: Smith, Johnson
Wrexham AFC: (3-5-2): Howard, Hayden, Tozer, Boyle (Evans 65), Barnett (Forde 88), Young, O’Connor, Lee (J.Davies 88), McClean, Mullin (Palmer 65), Dalby (Fletcher 65)
Subs: Okonkwo, Mendy
Referee: Carl Brook
Stockport County: Olaofe (22, foul)
Wrexham: Dalby (48, foul)