The Scot triumphed 6-3 in the 70th meeting between the two long-standing rivals, which featured five centuries, including four in successive frames.
O’Sullivan opened up with a 97, but Higgins levelled before producing the highest break of the tournament with a clearance of 145 and it proved the catalyst for a succession of outstanding breaks.
He followed it up with 110 before O’Sullivan replied with runs of 125 and 103 to draw level at 3-3.
But Higgins, a two-time Masters champion, was not to be denied this time and breaks of 134 and 88 put him in control and he closed out the match to set up a semi-final showdown with David Gilbert.
The 45-year-old told the BBC: “I enjoyed it. It was a really good high standard. There were only a couple of little mistakes we both made and it could have gone either way.
“I am delighted with the way I played and the way I turned up in a big game against one of the best players.”
O’Sullivan, who last won the competition in 2017, admitted he lost to the better man on the night in Milton Keynes.
He said: “I just made too many unforced errors. I know the breaks look pretty good on the scoresheet and if you look at that you’d probably say fantastic.
“But when you miss easy balls, unforced errors and some slack safety shots against someone like John – when he is playing as well as he was – you are not going to win.”
A score of 141 earned the tournament debutant a 6-5 win after a back-and-forth encounter.
Maguire produced a 137-break earlier in the match, but Yan saved his best till last to triumph.
Following victory over Neil Robertson in a deciding frame in the previous round, the 20-year-old is now only two wins away from a maiden major title.
Yan claimed the first two frames of this match, but quality was in short order until Maguire levelled the scores with a 102 break in the fourth.
It seemed the Scot had the momentum when he took the lead for the first time in the next frame, but consecutive half-century breaks put Yan back in front.
Maguire produced a 137 to restore parity, but his Chinese rival responded to move within one frame of victory.
A fluked red then helped Maguire to a break of 60, levelling the match at 5-5, but Yan closed out victory in style with a masterful break of 141.