Maguire struck in the 62 minute, blasting home from just inside the box after Portsmouth failed to clear a cross from the left, sending the Stadium of Light into wild celebration.
But those highs turned to lows five minutes later when Alim Ozturk was shown a straight red card for a lunging challenge on Gareth Evans. Portsmouth had attacked with pace, and the referee deemed Ozturk had thwarted a goal-scoring opportunity, ending the centre back's participation in the match and also next week's second leg.
But Sunderland held out to claim the win, albeit a narrow one, and will travel to Fratton Park for the second-semi-final with confidence.
The match was a scrappy affair with few chances until just before Maguire's opener.
But on the hour it all sparked into life, Lynden Gooch providing a perfect cross for George Honeyman, who rose inside the six-yard box only to see his point-blank header saved somehow by Pompey goalkeeper Craig MacGillivray, who got his face in the way to pull off a miraculous save.
Maguire's stunning strike came soon after, though, and Sunderland looked comfortable momentarily before the dismissal of Ozturk. From the resulting free-kick, Evans curled the ball flush on to the crossbar, and Portsmouth gained heart from that near-miss.
But despite much toil, it could not find a breakthrough and will head into the second leg hoping for more penetration than it was able to in the first.