The U's played some of their best football in weeks to end the Cobblers' three-game winning streak in League Two.
Northampton's defenders were appealing for offside as James Constable turned in Alfie Potter's low right-wing cross on 14 minutes.
It almost became two as Sean Rigg struck the post when Peter Leven played a free-kick to him, and then Jake Forster-Caskey drove against the bar from 20 yards.
The Cobblers levelled on 76 minutes as Clive Platt headed over goalkeeper Ryan Clarke.
But Oxford hit back three minutes later with sub Pittman running on to Leven's pass to fire in the winner. To add to the Cobblers' misery, defender Clarke Carlisle was sent off for a second yellow card in the final minute.