The Championship side were twice pegged back by the Cobblers, who netted through Holt and Thornton to take the League Cup tie into an extra half-an-hour.
Central defender Matt Mills then netted his second goal of the match and looked to have sent the Royals into the next stage of the competition but scored at the wrong end in injury time to ensure a penalty shoot-out.
There, Northampton keeper Oscar Jansson saved the home side's first spot-kick and saw his teammates keep their nerve to ensure a famous win.