Wrexham continue to hang on to League One status by their fingernails as Juan Ugarte led the way with a hat-trick in their must-win match at Stockport.
Juan Ugarte scored a first-half hat-trick for Wrexham
Oldham's loss at Chesterfield means they and MK Dons can still be overtaken by the Dragons next Saturday.
Ugarte's first came with his right foot after five minutes, then with his left and rounded things off with a header.
Carlos Edwards also weighed in, while Stuart Barlow grabbed already-relegated Stockport's consolation from close in.
Wrexham must now win at home against Brentford on Tuesday night to set up another nail-biter on the final day of the season next Saturday.
Stockport: Spencer, Goodwin, Raynes, Ashley Williams, Jackman, Hurst (Tomlinson 79), Briggs, Allen, Horwood (Hardiker 57), Barlow (Turnbull 81), Le Fondre.
Subs Not Used: Cutler, Robinson.
Booked: Briggs, Goodwin.
Goals: Barlow 27.
Wrexham: Foster, Pejic, Morgan, Lawrence, Edwards, Williams, Ferguson, Crowell (Bennett 86), Holt, Ugarte, Llewellyn.
Subs Not Used: Smith, Armstrong, Sam, Harrison.
Booked: Crowell, Llewellyn.
Goals: Ugarte 5, 11, Edwards 14, Ugarte 29.
Ref: J Singh (Middlesex).