The American made her debut last year, losing to Kim Clijsters in the first round, and she came through qualifying to reach the main draw this time.
Stosur edged the first set and it looked like Duval would head off court a plucky loser when the Australian, who beat Serena Williams in the final two years ago, went a break up in the second.
But Stosur's confidence has never been the most robust and Duval fought back to take the second set.
The crowd on Louis Armstrong realised they could be watching something special and roared their girl on as she broke 11th seed Stosur again to forge ahead in the decider.
Finishing the match was a nervy business, Duval seeing a match point come and go on the Stosur serve and then being forced to save break points when she served for it.
But on her third chance she put away a volley and leapt for joy at her 5-7 6-4 6-4 victory.
America appears to have a golden generation of young female players, but few of them have pulled off a result as spectacular as this.