The former world number one trailed 3-0 in the decider before securing victory after toiling for more than two hours.
Pulling off an upset seemed on Rogers’ mind as the American fended off three break points in the 10th game to clinch the first set.
Wozniacki wrestled back momentum in the second, converting two break points before firing back-to-back aces to force a decider.
Rogers raced to a 3-0 lead in the third set before Wozniacki staged a brilliant comeback, claiming six of the last seven games to advance to the next round.
“I knew she has powerful strokes and a big serve. it definitely was not easy,” Wozniacki said in a courtside interview. “I’m just happy to win this one.”
Earlier, Barbora Strycova registered her first win over a top 10 player this year when the Czech edged out Britain’s Johanna Konta 7-5 7-6(5).
Fourth seeded Konta dominated the early proceedings in her first meeting with Strycova and raced to a 3-0 lead before the Czech broke her back and went on to claim the first set.
Konta’s dominant backhand put her 5-4 ahead but the British number one could not serve out the second set, allowing Strycova to force a tiebreak and eventually seal the match.
“I’m very happy, because this match meant a lot to me,” Strycova said.
“I don’t have any words to say because I’m very emotional and very happy that I won against Johanna,” said the 31-year-old who meets Anastasia Pavlyuchenkova in the quarter-final.
Ninth seed Caroline Garcia beat local favourite Kurumi Nara 6-1 6-3 to set up a quarter-final clash with world number one Garbine Muguruza.
(Reporting by Amlan Chakraborty in New Delhi; editing by Pritha Sarkar)