The Red Devils were pegged back at the end of the first half by their League One opponents, although second-half goals from Ander Herrera and sub Marcus Rashford made sure of a place in the hat for the next round.
Victory for the Red Devils puts an end to their three-game losing run in all competitions and eases the pressure on Jose Mourinho, yet it was not all plain sailing for the Portuguese on what was a tricky evening at times at Sixfields.
The Englishman, one of just two players to retain his place in the side along with Chris Smalling, saw an even bigger chance come and go soon after when turning Ashley Young's cross wide of the target from a few yards out.
It was Michael Carrick who was pulling the strings for United on his first competitive start under Mourinho, and he was rewarded with a goal 17 minutes in after an indirect free kick 15 yards out fell nicely into his path.
Northampton's players were unable to push out after forming a big wall to keep out Rooney's initial attempt, leaving Carrick with an opportunity to fire the ball home from the edge of the opposition box, which he duly took.
The visitors were continuing to dominate things in terms of possession, even coming close to a second when Rooney tapped home after seeing Timothy Fosu-Mensah's back-post header come off the bar, only for the offside flag to go up.
Town had struggled to really get going for large parts of the first half, but they grew more and more into things and almost levelled up as only a slight Sergio Romero touch on Kenji Gorre's shot prevented the former United prospect from finding the net, with the ball skimming the bar on its way over.
United were unable to find any real momentum in the opening 10 minutes of the second half, which led to Mourinho taking drastic attacking action as he brought on both Zlatan Ibrahimovic and Rashford from the bench.
Despite the array of forward options on the pitch for the Red Devils it was left to Herrera to galvanise his side, with his shot from 20 yards out coming back off the upright on the hour in a sign of things to come.
Momentum was still proving hard to come by for a low-on-confidence United, but Northampton failed to learn their lesson 68 minutes in as Herrera this time picked out the bottom corner when teed up by Rashford.
Rashford wrapped up the win for his side with a fourth of the night 15 minutes from time, chasing down a ball-to-nothing over the top which Smith horribly swiped at without making contact, allowing Rashford to walk the ball to the line before hammering into the back of the net in front of the travelling supporters.
United were able to comfortably see out the remainder of the match to stretch their unbeaten run against the Cobblers to a fifth game, while at the same time ending their own recent barren run of form.