Wozniacki had to at least match her to stay No. 1, and the new Australian Open champion was pushed for nearly 2 1/2 hours before prevailing.
Wozniacki was so upset about the sounds coming from the other side of the net that she complained to French umpire Emmanuel Joseph. "But still when I will feel stronger pain, I think I will just think - I will double think about it and I will take the best decision".
Meanwhile, second seed Simona Halep breezed past CiCi Bellis 6-0, 6-4 earlier in the day, but later revealed a serious right foot injury.
The umpire said he thought everything was "regular", but Wozniacki added: "It's the only way she can win". "Angie is in such great shape, so I knew it would be an even playing field heading into the third set", Wozniacki said during her on-court interview.
The top seed recovered from a second set collapse to beat Kerber 7-6 (4), 1-6, 6-3 in a match lasting almost two and half hours on the hard courts of Doha.
She then broke Garcia early in the third set and held on to clinch the victory in almost two hours.
She also told Danish TV that her opponent had used "unfair methods".
The spat overshadowed a relatively routine victory for the 27-year-old, which ensured she retained her number one ranking after Simona Halep also advanced to the final eight.
I'm looking to play as many matches as I can.
"I think it's definitely a milestone".
Wozniacki will next play Petra Kvitova who claimed the 11th consecutive win, the joint second longest streak in her career.
The opening set was wrapped up in a little over half an hour by the world number two, who showed no mercy as she looked to continue to school the 18-year-old on centre court.
Muguruza beat Caroline Garcia of France 3-6, 6-1, 6-4 in the quarterfinals.