Wozniacki, plagued by an invasion of flying ants during the Court One clash, saved five match points but has now failed to get past the last 16 in 12 visits to the All England Club.
It was a bitter defeat for the 27-year-old Dane, who was expected to challenge for the Wimbledon title after winning her maiden Grand Slam crown at the Australian Open in January.
Wozniacki's frustration was only increased by the unwanted infestation that landed at Wimbledon during her match.
With flying ants stuck in Wozniacki's hair and dive-bombing her throughout the match, the former world number one asked the umpire if there was something that could be sprayed to keep the bugs away.
"They're in my mouth and in my hair and everywhere -- we need to do something. Is there a spray?" she said.
"I want to be here to focus on tennis, not eating bugs."
Wozniacki arrived in south-west London in good form on grass following her victory at the Wimbledon warm-up event in Eastbourne last week.
But once again she exits Wimbledon in embarrassing style, leaving the grass-court Grand Slam as the only one of the four majors at which she has never reached the quarter-finals.
Russian world number 35 Makarova faces Czech world number 66 Lucie Safarova in the third round.
"I couldn't win with a lot of match points, but I kept fighting and playing an aggressive game and finally it worked," Makarova said.
"I was really nervous, because you need to win this point.
"When it was 5-5 I started thinking about those match points on my serve at 40-0.
"But I told myself 'no, you are not going to lose this match'. I forgot it and started over."
Makarova, who had lost seven of her previous eight meetings with Wozniacki, is hoping to emulate her run to the Wimbledon quarter-finals four years ago.
The 30-year-old has twice made the semi-finals at a major -- both at the US Open.