Town had their noses in front for more than half an hour but they couldn't cope with the home team's blockbusting finale.
Joel Porter levelled the game at 3-3 from the penalty spot with just seven minutes remaining, Kevin Kyle heading his side ahead two minutes later and Porter running from his own half to make it five a minute from time.
In a first half almost as crazy as the finish, Hartlepool fought back to level the game twice, but didn't have time for a third equaliser before the half-time whistle gave both teams and the fans a breather.
Liam Dickinson's low free-kick had given the Terriers the lead after eight minutes, Kyle levelling with his head after already hitting the post.
Huddersfield regained the lead seven minutes before the break when Ian Craney raced onto a long clearance to finish well from 10 yards out, only for James Brown to head the home side level a minute later. The best goal of the half came a minute before the break when Dickinson struck again with a 25-yard free-kick, sending it into the top corner, before the fireworks late on.