French Open champion Sharapova, twice a Tokyo winner, was upset by Australian Stosur 6-4 7-6 in a quarter-final filled with drama and high-quality tennis.
"She played a very steady game and I had a few more unforced errors than I would have liked," Sharapova said.
"It's disappointing to lose but you have to take every disappointment and turn it into a positive. It's really about thinking what I can do to improve for the next tournament."
Eighth seed Stosur had won just one of her previous 11 meetings with Sharapova but seized the initiative by taking the first set when the Russian blasted a backhand long.
The Australian was taken to a tiebreak in the second after leading 5-3 but won a nail-biter 12-10 on her fifth match point after a wild forehand from Sharapova.
"When you don't take a few (chances) in a row you don't know what's going to happen," said Stosur, last year's U.S. Open champion. "But I just kept trying to go for it and thankfully it paid off."
Azarenka withdrew before her quarter-final with Germany's Angelique Kerber after coming into the WTA premier five event complaining of health issues.
The Belarusian, who won this year's Australian Open and reached the final of the U.S. Open earlier this month, had struggled to complete her third round match the previous day.
"Before the tournament I wasn't feeling very good," said Azarenka, who had her blood pressure checked during Wednesday's win over Roberta Vinci.
"I had low energy and I wasn't myself. It wasn't possible today. Maybe it was tiredness from the whole season. It's a little bit unknown what it is."
Kerber goes on to play Poland's Agnieszka Radwanska in the semi-finals after the number three seed defeated Caroline Wozniacki 6-4 6-3.
Stosur faces Russian Nadia Petrova in the other half of the draw, after she ousted sixth seed Sara Errani 3-6 7-5 6-3 after battling back from a set and 4-1 down against her Italian opponent.
Petrova later admitted she thought there was "no way back" at that stage, but she showed her superior power to get past the petite Italian.