Out since March because of a back injury, Davenport battled her own errors and lack of fitness in her first tournament since Indian Wells.
She led 4-1 in the first-set tiebreaker before Stosur tied it at 4. Davenport won the final three points, including two on Stosur's backhand errors.
Stosur earned the only service break of the second set at 3-2. She closed out the set on a forehand passing shot. After a brief break because of the heat, Stosur raced to a 5-2 lead in the third. Davenport, a four-time winner of her hometown tournament, double-faulted on match point.
Stosur improved to 21-16 in singles matches this year. She has yet to win a WTA Tour singles title, although she forms one of the tour's top doubles teams with Lisa Raymond. They won this year's French Open title and reached the semifinals at Wimbledon, the AP reports.
Davenport has an 8-4 match record in four tournaments this year, with the U.S. Open three weeks away. She has slipped to 10th in the rankings.
Last year's surprise semifinalist Daniela Hantuchova beat Raymond 7-6 (2), 6-3 to reach the third round.
Hantuchova hit eight aces and improved her record against Raymond to 3-1.
A top-five player three years ago, Hantuchova has run hot and cold this year because of illness and injury, and the Slovak has saved her best efforts for the Grand Slams, where she's made it to the round of 16 in all three.
Sixth-seeded Anna-Lena Groenefeld of Germany broke Akiko Morogami of Japan twice in each set en route to a 6-3, 6-2 win.
Shahar Peer of Israel defeated Paola Suarez of Argentina 6-2, 6-3 and will meet third-seeded Elena Dementieva next, and Marion Bartoli of France dispatched Jill Craybas of the United States 6-2, 6-0.
Medicinal properties of Nigella sativa (nutmeg flower) herb, which is commonly used in culinary as a seasoning, against COVID-19 have not been fully proven