Last updated on .From the section FA Cup
The National League knocked the Championship side out of the cup.
Sam Dalby and Elliot Lee scored in the first two minutes of the game to give Wrexham a 2-0 lead.
Paul Mullin's penalty looked to have sealed the win, but Jonathan Panzo was sent off for handling the ball.
After the 10 men were sent off, substitute Viktor Gyokeres got one back for the visitors.
They will be in the draw for the fourth round of the FA Cup for the first time in over a decade after holding on for the win.
Dalby rose high between two defenders to head the National League side ahead.
The travelling fans behind the goal were in for a treat just five minutes later, as Lee's back-post cross for Mullin caught out Simon Moore in the goal and went in to the delight of the travelling fans.
The Championship side found a way back into the contest before half time when Sheaf stroked home from near the penalty spot.
In first-half added time, Dalby nodded the ball back across goal to O'Connor, who headed it home to make it three for the visitors.
Panzo was shown a red card for blocking a goalbound effort with his arm in the second half.
Mullin stepped up calmly and sent Moore the wrong way with his fourth goal.
The Sweden international finished from close range to reduce the lead to two.
The lead was down to one by the time Palmer's curling free-kick beat Howard.
Howard was able to push the rising effort onto the post.
The National League side booked their place in the fourth round when they were unable to find a way through in the closing stages of the game.