Top-ranked Victoria Azarenka withdrew after a bout of dizziness in her third-round match on Wednesday, advancing Angelique Kerber of Germany to the semis.
Nadia Petrova of Russia, down 6-3, 4-1, overcame sixth-seeded Sara Errani of Italy 3-6, 7-5, 6-3, and will play Stosur on Friday.
Former No 1 Caroline Wozniacki faced third-seeded Agnieszka Radwanska of Poland in the late quarter-final.
Stosur broke Sharapova to go up 5-3 in the second set but then lost nine straight points as Sharapova 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."
It was only Sharapova's second loss in 11 matches to the Australian, who has reached her first semi-finals since the French Open.
Sharapova, who won this tournament 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," she 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."
Azarenka withdrew after a bout of dizziness in her third-round match on Wednesday, advancing Angelique Kerber of Germany to the semis.
"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."