Stosur, who stunned Serena Williams in the final last year, fought back impressively after a poor first set but was edged out in the final tie-break, with Azarenka winning 6-1 4-6 7-6 (7/5) to reach her first US Open semi-final.
The top seed has looked back to the form that helped her to 26 wins in a row at the start of the season, including her first grand slam title at the Australian Open.
She had dropped only 10 games on her way to the last eight and was facing a player she had not so much as dropped a set against in six previous meetings.
Stosur made the worst possible start by dropping her serve and was 3-0 down when a very heavy rain shower forced the players off court for more than an hour.
The Australian at least got herself on the board on the resumption but was making too many unforced errors and a backhand drilled well over the baseline handed the set to Azarenka.
Stosur began the second set well, breaking her opponent's serve for the first time and, although the Belarusian hit straight back, it was a much more even contest now.
Watch: Azarenka into semis, Sharapova delayed... More Videos
Indeed, it was the seventh seed who gained the advantage again in the seventh game with another break and this time she held on despite heavy pressure from Azarenka.
It was an impressive effort from Stosur, who is not known as the toughest mentally, and twice she hit back after being broken in the third.
Azarenka was throwing everything at her opponent but she refused to buckle, and Stosur even had a break point at 5-5 only for the top seed to come up with an ace.
The match was decided on a tie-break, and Stosur made a terrible start, losing the first four points. She recovered three straight away, and they were back on serve when Azarenka betrayed her nerves with a massive double fault to make it 5-4.
A drop shot gave her the first match point, though, and she took it when a forehand that landed on the baseline proved too good for Stosur.
It was the first time for five years that a women's match in the quarter-finals or later had been decided by a tie-break, with Azarenka finally prevailing after two hours and 23 minutes.
The 23-year-old said: "I think we both showed some excellent tennis. You could feel the pressure all the time. We really both gave it our all, fought really hard, kept making each other run like crazy."
The result means Azarenka is guaranteed to be world number one at the end of the tournament, but she added: "I don't want to stop yet."