Australian Open champion Wozniacki breezed through the opener in just 25 minutes before world number 82 Puig started the comeback.
Puig broke Wozniacki’s serve in the second set to take a 4-2 lead and closed it out to even the match, and the 24-year-old Puerto Rican then earned an early break in the decisive set to go ahead 2-0 and held on for the victory.
Ukrainian fourth seed Elina Svitolina ended Naomi Osaka’s remarkable recent run with a 6-4 6-2 triumph over the Indian Wells champion.
The 20-year-old Japanese, who followed her Indian Wells title run with a first-round victory over Serena Williams this week, had no answer to Svitolina during their 83-minute clash.
Svitolina, who last month claimed the sixth title of her career with her triumph at the Dubai Open, said she was prepared for the test of Osaka.
“I was like, ‘OK, this is going to be challenging,’” Svitolina said.
“For a second round, normally you don’t get those kind of matches. It was actually quite exciting. I like to go into the tournaments with little bit of stress. Then you’re straight into the matches. I’m very happy the way handled this match today.”
The Ukrainian will next face Australian 26th seed Daria
Gavrilova, who defeated German Andrea Petkovic 7-6(3) 6-4.
Venus Williams was unhappy with her shaky performance against qualifier Natalia Vikhlyantseva but advanced 7-5 6-4.
Williams, a semi-finalist at the BNP Paribas Open last week, committed five double faults and had her service broken four times in the match.
Sixth seed Jelena Ostapenko defeated Timea Babos 6-4 6-4 while ninth-ranked Petra Kvitova outlasted Aryna Sabalenka 7-5 3-6 6-3.
Sofia Kenin, a 19-year-old qualifier, upset 19th-seed
Daria Kasatkina, a finalist last week at Indian Wells, 3-6 6-2 6-2. Australian 21st seed Ashleigh Barty also reached the third round with a 6-0 7-6(0) win over American wild card Claire Liu.