The 34-year-old, a double Australian Open champion who has also won two titles in the Queensland capital, outlasted fellow grand slam winner and third seed Ostapenko 6-3 3-6 7-5.
Azarenka will play the winner of the quarter-final showdown between reigning Melbourne Park title-holder Aryna Sabalenka and Russia's Daria Kasatkina for a place in the final.
Azarenka sent down 16 aces to her rival's two and capped her unforced errors at 20, almost half of Ostapenko's total, to set up the win.
The firepower of both players was on full display during the two-and-a-half-hour clash, with Latvia's Ostapenko erupting at the umpire in frustration when Azarenka went ahead 5-4.
Jelena Ostapenko debates a call with umpire Julie Kjendlie during her quarter-final loss. (Zain Mohammed/AAP PHOTOS)
"I never want you on my matches ... you ruin my match," the world No.12 told the umpire Julie Kjendlie after disputing a double-bounce decision.
Ostapenko broke early in the third set, blasting a backhand winner to go ahead 3-2, but she couldn't shake the dogged Belarusian - winner of the Australian Open in 2012 and 2013 - who broke straight back.
Trailing 5-6 and facing two match points, 26-year-old Ostapenko sent a smash into the net to hand victory to her rival.
Former world No.1 Azarenka, currently ranked 21st, said she had prepared for a battle with her Latvian rival, who won the French Open in 2017.
"With Jelena, sometimes you just have to put on a helmet and try to stay in there," Azarenka said.
"She's an incredible player and a grand slam champion, and she's proved many times she can beat anybody on any given day.
"The quality of tennis was incredible, so to be able to go through ... I'm very proud."
Elena Rybakina eased into the last four in Brisbane after opponent Anastasia Potapova retired hurt. (Zain Mohammed/AAP PHOTOS)
Wimbledon champion Elena Rybakina had it far easier when Anastasia Potapova retired in their quarter-final after losing the first set 6-1.
She had been receiving treatment for an abdominal injury and eventually conceded after attempting to play on.
Rybakina, who has also been in exquisite form, will play the winner of the match between Linda Noskova and Mirra Andreeva - the Czech and Russian teens set to duel later on Friday.