Mark Beevers opened the scoring for the home side in Saturday's second-round tie at Hillsborough while Billy McKay and Kevin Thornton found the net for Northampton.
Beevers gave Wednesday a sixth-minute lead with a close-range header after meeting Tommy Spurr's corner.
Miller increased Wednesday's lead eight minutes before the break from the penalty spot after Neil Mellor was tripped in the area by Liam Davis.
McKay then scored in the 56th minute after being left unmarked to give the Cobblers hope.
It looked to be all over when Miller converted a stoppage time penalty conceded by Paul Rodgers but Thornton scored with a quickly-taken free-kick to give Northampton a glimmer of hope at the death.