Dominic Blizzard's second-half goal gave Stockport all three points against bottom placed Wrexham.
The visitors had taken a 25th-minute lead after Marc Williams headed Neil Taylor's cross past Conrad Logan.
But Wrexham's lead lasted just three minutes with Anthony Elding equalising for the home side.
And then in the 64th minute Blizzard out-jumped the Wrexham defence to head Paul Tierney's corner past Anthony Williams for 2-1.
Stockport: Logan, Smith, Owen, Williams, Tierney, Proudlock (Poole 75), Taylor, Blizzard, Griffin (Rowe 90), Elding, McNeil. Subs Not Used: Dicker, Tansey, Jones.
Goals: Elding 29, Blizzard 65.
Wrexham: Anthony Williams, Spender, Evans, Hope, Taylor (Pejic 63), Carvill, Danny Williams, Spann (Crowell 46), Done (Ugarte 69), Mark Jones, Marc Williams. Subs Not Used: Roberts, Michael Jones.
Booked: Mark Jones, Hope.
Goals: Marc Williams 26.
Ref: Colin Webster (Tyne & Wear).