Wozniacki was a 6-4, 2-6, 6-2 winner over the fifth-seeded Russian at Arthur Ashe Stadium. Sharapova won this event in 2006.
No. 13 Errani opened the day with a 6-3, 2-6, 6-0 win over 32-year-old qualifier Mirjana Lucic-Baroni. Lucic-Baroni's impressive run comes to an end after making 69 unforced errors compared to just nine for her opponent.
Lucic-Baroni, who entered this tournament on an eight-match losing streak, last made the fourth round of a Grand Slam in 1999. She was also looking to become the first qualifier to reach a women's quarterfinal of the US Open since American Barbara Gerken in 1981, but came up just short.