Billed as the Battle of the Blondes, the 20-year-old Dane won through 6-3, 6-4, but not before a fired-up Sharapova had brought out the best in her.
Wozniacki next plays the unseeded Dominika Cibulkova for a place in the semi-finals as she bids to go one better than last year, when she lost in the final to Kim Clijsters.
Cibulkova topped 2004 US Open winner Svetlana Kuznetsova of Russia 7-5, 7-6 (7/4) to reach a Grand Slam quarter-final for the second time in her career.
Also through was Estonian 31st seed Kaia Kanepi, who bounced back from being blitzed in the first set to defeat Belgium's Yanina Wickmayer 0-6, 7-6 (7/2), 6-1.
Her quarter-final opponent would be decided in a night session match at the Arthur Ashe Centre Stadium court with Wimbledon runner-up Vera Zvonareva of Russia taking on the unseeded Andrea Petkovic of Germany.
The Wozniacki-Sharapova match had been expected to come down to the Russian's explosiveness against the Dane's dogged consistency and so it turned out to be.
Sharapova, back to near her best after a long battle against injury, had 32 winners to 16 for Wozniacki, but had 36 unforced errors against 10 for her opponent.
But more tellingly, Sharapova's serve let her down at key points in both sets, handing breaks to Wozniacki that she was able to capitalize on.
"Even with those unforced errors, I still had my chances and I was one-for-eight on breakpoints," she said.
"Against someone that's playing really well, playing with a lot of confidence, it's really important to take those chances that you have, the very few that come your way.
"I felt like I played a couple of good points and then made an easy error, hit a return long or miss a first serve, give her many looks at second serve returns."
Wozniacki said that her run into the final last year had given her healthy doses of confidence and experience.
"I definitely think I've improved a lot, not only physically, but also I believe in myself more," she said.
"I believe I can do it. Also I think I can mix up my game a little bit more than I could last year."
Kanepi, who matched her run into the Wimbledon quarter-finals in July, said that her 0-6 start to her match against Wickmayer did not totally surprise her.
"I have problems starting the matches. Sometimes I'm very slow. Then sometimes it's too late to get going. I think I'm getting better now. But, still, it's the point where I have to improve," she said.
"Then in the third set I think I was like in the zone or something. I was just fighting every point. I tried to relax, also not think about the win. I played well."
Cibulkova matched her run into the quarter-finals at the 2009 French Open with a second win this year over Kuznetsova, who won the title here as a 19-year-old in 2004.
At just 5 feet 3 inches (1.59 metres), one of the smallest players in the tournament, she said that her stature gave her other advantages that had worked well in New York.
"I'm pretty fast on the court," she said.
"I have no problem with long rallies, and I really like to step into the court and play fast and not give time to my opponent.
"I'm still working on my serve, because it still can be better. My game is just trying to play fast and not let my opponent push me."
The quarter-final line-up in the bottom half of the draw was decided on Sunday with defending champion Kim Clijsters set to play Australian fifth seed Samantha Stosur and third seed Venus Williams paired with French Open champion Francesca Schiavone of Italy. Both matches will be played on Tuesday.