On-loan striker Adam Birchall inspired a devastating second-half performance from Barnet to set up a first FA Cup third round appearance since 1994.
Birchall, a former Arsenal trainee on loan from Mansfield Town, scored the first and made the second as the home side scored four second-half goals to set up a potential money-spinner.
Barnet had looked unlikely scorers in the first half, but scored through Birchall, Dean Sinclair, Ian Hendon and Magno Vieira in a rampant second period.
Northampton are 24 places above Barnet in the Football League, but they were made to look like amateurs in the second half as the Bees poured down the Underhill slope.
The first period was largely uneventful and there were more meaty challenges than clever passes as both sides crowded the midfield.
Barnet had more of the play but could not carve out a clear opening, despite some neat flick-ons from Liam Hatch and trickery on the left from Jason Puncheon.
The Cobblers had the game's first clear chance after 25 minutes when a clever reverse pass from James Quinn put Scott McGleish through. The striker rounded Bees keeper Lee Harrison but could only hit the side-netting from a tight angle.
The away side took the lead in the 44th minute with the best move of the match. After neat inter-passing on the edge of the Barnet box, David Hunt's floated cross found former Barnet striker McGleish, who powered his header past Harrison.
But Barnet boss Paul Fairclough must have produced the half-time team talk of his life, as Barnet came out a different side.
The home side drew level with a goal from Birchall on 49 minutes, who took advantage of sloppy defending to poke in his first goal for Barnet.
Just minutes later, they were ahead. Hendon found Birchall on the left, and the striker's cross was met by Sinclair, who glanced his header past Mark Bunn to the delight of the home fans.
Barnet were playing like a team possessed and had a strong penalty claim turned down when Andy Holt seemed to haul Hatch down.
But they got a penalty on 67 minutes when the busy Puncheon was brought down chasing a loose ball. Hendon stepped up and fired his penalty high and straight into the Northampton net.
The home team were rampant and had a host of chances before scoring a fourth, when substitute Vieira latched on to Puncheon's low ball to fire high into the Town net.