Goals from defensive duo Steve Blatherwick and Ian Evatt boosted Chesterfield's hopes of avoiding relegation with a 2-1 home win.
The home side's committed display exposed weaknesses in the shaky Wrexham defence and dented their promotion bid.
Denis Smith's side cracked in the 70th minutes when Blatherwick looped a header over goalkeeper Andy Dibble.
Although Wrexham substitute Chris Armstrong hit back quickly, Evatt struck late to win it for Chesterfield.
After Blatherwick broke the deadlock, Armstrong grabbed his first league goal for the Dragons when he pounced on
a rebound.
But Chesterfield had the last word when the Welsh side were caught out by a right-wing cross, allowing new loan signing Jamie McMaster to set up Evatt to drive a right-foot shot past Dibble from 12 yards.
Chesterfield: Muggleton, Uhlenbeek, O'Hare, Blatherwick, Evatt, Allott, Innes, Niven, Brandon, Robinson, Hurst. Subs: Dawson, Howson, Reeves, Richmond, McMaster.
Wrexham: Dibble, Carey, Lawrence, Morgan, Carlos Edwards, Whitley, Ferguson, Paul Edwards, Barrett, Sam, Llewellyn. Subs: Whitfield, Armstrong, Crowell, Mark Jones, Spender.
Referee: K Wright (East Anglia)