The Cobblers made a bright start with Roy O'Donovan twice going close before the recalled Jacob Blyth popped up with a seventh-minute opener.
O'Donovan helped on a long clearance and Clive Platt released Blyth to produce a neat finish past Artur Krysiak.
The goalscorer then headed over before missing an excellent chance to double Northampton's advantage when he shot wide with just Krysiak to beat.
Platt also went close midway through the first half but his shot came back off the bar.
That woke up Exeter with Jimmy Keohane shooting wide of the target, however the hosts remained on the front foot, Darren Carter going close and Platt heading over.
The visitors drew level in the 35th minute when Scot Bennett beat Matt Duke from Craig Woodman's delivery. Northampton almost regained the lead, yet Matt Heath's header was saved by Krysiak.
Chris Hackett saw his shot blocked by Liam Sercombe after the restart, Heath saw another effort blocked by Bennett and Platt headed over as the Cobblers looked to regain the advantage. Northampton maintained the upper hand and Blyth went close with a superb effort which went just wide.
Exeter rarely threatened but Sercombe fired over just past the hour mark and Arron Davies drilled wide, while the impressive Platt also tested Krysiak at the other end.
But O'Flynn was to head home from fellow substitute David Wheeler's cross to snatch all three points.