Jon Stead scored his first goals for Harrogate but saw red as Jamie Reid's late double sealed a comeback win for the hosts.
Harrogate took the lead with a 33rd-minute penalty, converted by Stead after he had been fouled by Kyle Cameron.
Jake Andrews levelled in the 51st minute but within seven minutes the visitors were ahead again when Stead got on the end of a low George Smith cross.
However, things unravelled for the visitors inside the last 27 minutes, after the widely-travelled 36-year-old was dismissed for a second yellow card.
Kalvin Kalala levelled with a 25-yard curler, Reid made it 3-2 three minutes later at the second attempt after his penalty had been saved by Jordan Belshaw, then made the points safe with 10 minutes remaining.
Report supplied by PA Media