Jamie Forrester's Golden Goal from the penalty spot gave Northampton the win in a highly entertaining game at Edgar Street.
Forrester had put the Cobblers in front after just 25 seconds only for Chukki Eribenne to level five minutes later.
Eribenne levelled once again for the Bulls on 32 minutes to cancel out Paul Rickers' 11th minute strike.
Hereford looked to have sealed a famous victory when Paul Parry shot them in front with eight minutes to play, but Mick Galloway's own goal right at the death brought about extra time.
Andy Tretton fouled Chris Carruthers in the 95th minute in an off the ball incident and Forrester made no mistake from the spot