The world number eight raced through the first set 6-1 before the 2012 junior Australian Open champion finally got some rhythm to win four successive games in the second set and take a 5-2 lead.
Nerves, however, got the better of Townsend as Wozniacki scrambled back to 5-4 before she saved three set points to level at 5-5.
The former world number one then raced through the tie-break to win 6-1 7-6 (7-4) and set up a tricky quarter-final clash with Germany's Julia Goerges.
Third seeded Williams, who spent less than an hour on court on Tuesday, took a little longer to overcome Japan's Kurumi Nara 6-4 6-1 on Wednesday and set up possibly the pick of the quarter-finals where she will face Russia's Elena Vesnina.
The Russian world number 64 has a 2-1 career record over Williams, including a sensational 6-1 6-3 victory over the American in the first round at Wimbledon in 2012.
"When I played her at Wimbledon it was very special," Vesnina told reporters. "I won that match in two sets and I was so happy because I didn't expect it.
"She's a super great player, but on grass she's the best of the best and to beat her there was amazing and I'm always saying this is the biggest win of my career.
"I'll go on the court and I'll try to show my best tennis, I'll try to play aggressively, move her around.
"Whenever you go on court you want to win the match no matter who you're playing."
(Reporting by Greg Stutchbury in Wellington; Editing by John O'Brien)
Share
