Stosur broke Sharapova to go up 5-3 in the second set but then lost nine straight points as the Russian sent the match to a tiebreaker, which Stosur won on her fifth match point when Sharapova returned long.
"I knew that I had lost nine points and was just trying to stop the momentum swing," Stosur said. "I wasn't thinking about the points I lost but was focusing on how I was going to make the next points."
"Before the tournament on Sunday I was starting to feel not really good," Azarenka said. "I haven't really been doing better since then. Just low energy, you could tell by the matches I wasn't my usual self. But it took too much energy over the last two matches to really push and today it's just not really possible for me."
Also, Nadia Petrova of Russia, trailing 4-1 in the second set, overcame sixth-seeded Sara Errani of Italy 3-6, 7-5, 6-3. She will next face Stosur on Friday. Defending champion and third-seeded Agnieszka Radwanska of Poland beat former No. 1 Caroline Wozniacki 6-4, 6-3 in the late quarterfinal and will face Kerber in the semifinals on Friday.
For Sharapova, it was only her second loss in 11 matches against Stosur, who has reached her first semifinal match since the French Open.
Sharapova, who won the tournament in Tokyo in 2005 and 2009, struggled with her serve and had five double-faults.
"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."