Ben Thompson bagged his first Blues goal two minutes before the break to hand Kenny Jackett's side a half-time lead.
Then Oli Hawkins, Jamal Lowe and substitute David Wheeler struck after the restart, clinching the club's first win in the competition since 2016.
Pompey saw a lot of the ball in the opening exchanges and should have gone ahead after 22 minutes.
Gareth Evans, making his 150th Blues appearance, saw his fierce drive parried by Magpies goalkeeper Carl Pentney in to the path of Tom Naylor, who poked his effort against the crossbar from all of six yards.
Maidenhead were carrying a threat on the counter-attack, with Pompey having the woodwork to thank for not going behind two minutes later.
Ayo Obileye took a pass in his stride superbly, before unleashing an effort from just inside the area which came back out off the post.
Just as the Magpies were startingÂ to look comfortable, the BluesÂ took the lead two minutes beforeÂ the interval.
Ronan Curtis, who'd been the visitors' biggest threat, picked out Ben Thompson and he volleyed home his maidenÂ Blues goal.
Pompey looked settled after the restart, doubling their advantage on 55 minutes.
Evans' pinpoint delivery picked out Hawkins and his precise looped header left keeper Pentney with no chance.
Winger Jamal Lowe then got in on the act as the visitorsÂ put the game beyond the Magpies after an hour.
Ben Thompson's free-kick was headed across goal by Jack Whatmouth and Lowe fired in to the bottom corner on the turn.
There was still time for PompeyÂ to bag another,withÂ substitute Wheeler headingÂ home on the rebound after Pentey parriedÂ full-back Lee Brown's free-kick seven minutes from time.