Williams was fractionally off target with an attempted forehand winner at 5-4 in the third set and the gutsy seventh seed battled back to set up a clash with fourth seed Jelena Jankovic.
Stosur made full use of her impressive physique to overpower Williams for almost two sets but looked to have blown her chance after serving for the match in the second.
Yet, she held her nerve in a dramatic decider to win.
Stosur will be hoping to continue her good form into the semi-finals to make up for last year, when she lost to eventual champion Svetlana Kuznetsova in the last four.
The 26-year-old had outplayed four-times champion Justine Henin in the fourth round and was better than Williams, the 2002 champion, for most of a two hour-24 minute quarter-final as the sun finally returned to Court Phillipe Chatrier.
Stosur had already assured her place in French Open folklore by ending Henin's six-year unbeaten run at Roland Garros.
However, leading Williams by a set and 5-3, having taken an astonishing 17 consecutive points from 3-2 in the first set, Stosur failed to finish off her opponent and nearly paid the price.
"I got a little bit nervous and a little bit tight, but overall, I actually felt good," Stosur said after her first win over a current world number one.
"It's not really a pressure. I guess everything is just adrenaline and all the emotions hitting you kind of at once.
"That third set I just kind of hung in there, and I was behind the whole time serving second.
"I had to wait for another opportunity and then I got one at 6-6 and thankfully I took it."
Stosur tried to dominate the match with her fierce early-struck forehand and it worked a treat against a leaden-footed Williams as she broke twice to take the opening set.
From 3-2, 30-30, she went on a 17-point streak that seemed to have knocked the stuffing out of a mistake-riddled Williams but the American 12-times grand slam champion, who racked up 32 unforced errors in the first two sets, rarely departs without a scrap.
She broke Stosur and looked to be building up a comeback as she levelled the second set at 5-5 before storming through the tiebreak 7-2.
Stosur was forced to hang on in the decider as Williams began to blast away and she received a big let-off when the American's forehand floated long on match point.
All of a sudden the momentum changed and two brilliant points, a forehand pass and a stunning backhand, sealed a break at 6-6 and when she served for the match for a second time the Australian proved up to the task.
There was some consolation for Serena hours later when, together with her sister Venus, she came back to beat Liezel Huber, of the United States, and Anabel Medina Garrigues, of Spain, 2-6, 6-2, 6-4 to reach the women's doubles final.
The top-seeded Williams sisters are looking for their 12th Grand Slam doubles title together and fourth in a row.
They previously won the French Open in 1999.
In this year's final at Roland Garros, they will face the 12th-seeded pair of Kveta Peschke of the Czech Republic and Katarina Srebotnik of Slovenia.