The Russian-born Sharapova was 17 when she defeated Williams in the 2004 Wimbledon final. Rather than proving the start of a long, close-run rivalry, it was one of just two victories Sharapova can claim against the US great, who has beaten her 19 times.
Maria Sharapova is expected to jump from 146th to around 100th in the world rankings.
Wozniacki was furious that her second round match was played on an outside court while five-time major winner Sharapova was playing all of hers in Arthur Ashe Stadium.
Former world number one Sharapova, the 2006 US Open winner in her first Grand Slam since serving a 15-month doping ban, downed the 139th-ranked wildcard 7-5, 6-2 and moved into a fourth-round clash with Latvian 16th seed Anastasija Sevastova.
Maria Sharapova, ranked 146th, played only one US Open tuneup match due to a forearm injury but wore down Simona Halep and Babos to prove she's a threat for a deep run.
The 30-year-old five-time major winner and former world number one was hit by a 15-month suspension after failing a drugs test at the 2016 Australian Open.
Maria Sharapova's comeback began with an April semi-final run at Stuttgart but many rivals complained about wildcard entries she received to assist her fight back to top form.
Sharapova tested positive for meldonium at the 2016 Australian Open and was suspended by the International Tennis Federation, a ban that ended in April.
Maria Sharpova has still only played four tournaments since returning in April from a 15-month doping ban for the use of meldonium.
The injury will cast further doubt over Maria Sharapova's participation at the US Open, the last Grand Slam event of the season which starts in New York on August 28.
With the 23-time Major winner preparing for the birth of her first child and the Russian out with an injury, the race to the Venus Rosewater Dish is wide open.
Maria Sharapova said she will not request a wildcard for Wimbledon, instead opting to play in qualifying for the Grand Slam she won in 2004.
Former world number one Maria Sharapova vowed to "rise up again" after she was refused a wildcard for the French Open following her 15-month ban for doping.
Maria Sharapova was banned for two years for using meldonium, with the penalty later reduced by the Court of Arbitration for Sport which ruled she was not an intentional doper.
After winning three rounds since her return to tennis after serving a doping ban, Maria Sharapova fell in three sets to Kristina Mladenovic in the semifinals.
Since her return after a 15-month ban, the Russian is yet to drop a set
The Russian five-time Grand Slam winner beat world No 43 Ekaterina Makarova in straight sets in the second round, will play Estonian qualifier Anett Kobtaveit next.
Russia's Sharapova -- the world's highest-paid female athlete for more than a decade until last year, according to Forbes -- won on Wednesday on her comeback after testing positive for meldonium.