The game finished 1-1 after normal time, Jamie McCombe heading in for the home side before Craig Westcarr responded.
In a breathless first half, McCombe gave the Lilywhites the lead after 16 minutes when he climbed highest to glance in Paul Parry’s corner.
That goal shocked the Spireites into life and they were back level only 10 minutes later when Westcarr tapped into an empty net after Preston failed to clear their lines.
The game settled down after the break, but Tommy Lee had to be at his best to deny Neil Mellor a stunning winner with 15 minutes remaining.
And it was Alexandre Mendy who proved to be the hero as he slotted home after the normally dependable Graham Alexander and Paul Coutts missed for the home side.