Ian Taylor's fourth goal of the season enabled Northampton to leap frog Oxford and climb into the top six in League Two.
Taylor struck against the run of the play 16 minutes from time when David Hunt's long throw was flicked on by Scott McGleish and the former Derby and Aston Villa midfielder headed home at the back post.
The result was rough on Oxford who saw an unbeaten seven-match league run ended, while also conceding their first goal in four matches.
For Northampton though, it is now just one defeat in 12 league matches and three straight clean sheets.
Oxford's hopes of salvaging a point went west in the final minute when defender Leo Roget saw his powerful header from a Chris Hackett corner headed off the line by substitute David Rowson.
And Oxford had penalty appeals turned down when former Northampton striker Eric Sabin tumbled in the box.
The first half had few clear-cut chances, although Oxford created the better of them.
A sweeping 35th-minute move involving Craig Davies and Sabin ended with a pass inside to Lee Mansell, whose fierce low shot looked destined for the net, only for Lee Harper to pull off a brilliant save, pushing the ball around the post.
Northampton will be looking to the subtle skills of Martin Smith to maintain their promotion push and he went close in the 20th minute when he sliced the ball just wide of the post after a McGleish touch.
The other hero for the home side was defender Chris Doig who suffered a gashed head during the first half after an aerial collision. By the end of the night, he had worn five separate shirts after a series of quick changes of bloodied jerseys.
Shortly before grabbing the winner, Taylor escaped at the other end when he almost turned a Sabin cross into his own net.
Northampton were also able to introduce loan signing Junior Mendes for 29 minutes after his switch from Huddersfield.