Having taken a ninth-minute lead through Milan Jovanovic, his first goal since joining the club from Standard Liege in the summer, the hosts should have wrapped up the third-round tie.
But Billy McKay and Michael Jacobs turned things around, and although David Ngog snatched a late equaliser the Cobblers went through on spot-kicks.
For the first time in five years Liverpool have not got past the third round, denying them a chance in a competition they were thinking about winning.
Those chances were increased by the exits of the likes of Chelsea, Manchester City and Tottenham but an under-strength team failed to deliver.
It would have not been so bad had the Cobblers come to Anfield and given a particularly stirring performance but they were only really energised by McKay's goal, growing in confidence as their opponents' gradually receded.
Worringly for manager Roy Hodgson, Northampton goalkeeper Chris Dunn was hardly tested.
The Liverpool boss, as he has done in the Europa League, handed the responsibility to a number of fringe players after opting to rest all those who started in the defeat to Manchester United on Sunday.
If he was looking for a reward he did not get one as the team laboured in failing to dispatch opponents 69 league places below them.
The signs were there before the start as the Cobblers had already beaten higher-placed opposition in League One Brighton and Championship side Reading.
Their league form, however, was worse than Liverpool's with only one win in their last eight games and that was indicative of the way they started as the home side dominated.
Prior to the match there had been much fuss about nothing when centre-back Daniel Agger had felt the need to publicly clarify comments he made on Sunday, which were misrepresented as him saying he would not play Hodgson's long-ball game.
Not that he needed to prove a point but he did with a perfectly-judged defence-splitting pass through the inside-left channel which Serbia international Jovanovic collected and fired past Chris Dunn and into the far corner of the net.
Despite dominating possession, Liverpool's rearranged defence gave their opponents too much time on the edge of the penalty area.
Twice Jacobs was allowed to turn and shoot but on both occasions he failed to hit the target, although his curling effort from the left angle of the box briefly had debutant Brad Jones worried as it arced towards the far corner.
Ryan Gilligan also blazed wide from 12 yards after Wilson failed to clear a free-kick.
The second half began similarly until McKay struck in the 56th minute. Kevin Thornton out-jumped Sotirios Kyrgiakos to head Liam Davis' hanging cross into the path of the striker and he blasted home from close range.
In an instant the match appeared to turn on its head as Northampton then became the team in the ascendancy as Liverpool toiled.
Only in the last five minutes of normal time did they push for the winner but the visitors' defence held out to force extra-time.
There was a feeling an upset was on the cards and a second Northampton goal duly came in the 98th minute.
Wilson, a central defender playing at left-back, was too easily beaten by substitute Courtney Herbert.
Jones parried the cross, Martin Kelly stopped Thornton's half-hit shot, but Liverpool could do nothing about Jacobs' follow-up.
Kyrgiakos headed wide and Kelly fired into the side-netting before Ngog hauled Liverpool level with a headed goal from substitute Jonjo Shelvey's corner.
Even then both sides could have snatched a win at the death but Kelly cleared off the line from Nathaniel Wedderburn's shot and Davis deflected over a header from Kyrgiakos.
Northampton's Steve Guinan and Liverpool's Ngog missed the first spot-kicks but when 19-year-old substitute Nathan Eccleston hit the crossbar with Liverpool's fourth effort Abdul Osman stepped up to send the Cobblers into the last 16.
The result will only increase the scrutiny on Hodgson, whose side have had a disappointing start to the Barclays Premier League and are currently 16th.