Three second-half goals from Barnet at Sixfields gave them the points and left Northampton with just two wins from their opening six league games.
For a club looking to bounce back into League One at the first attempt that record spelled the end for manager Stuart Gray.
Chairman David Cardoza made the decision 'with a heavy heart', but said: "It is necessary to consider what is in the best interests of the club both long term and to try and win promotion this season."
Ian Sampson was handed the reins on a caretaker basis.