On a sweltering evening that contrasted with the rain-hit opening days, Gauff took to Arthur Ashe Court with the backing of a partisan crowd and hopes of continuing her pursuit of a third grand slam title.
But it was no simple task against the world No.87, who, despite the gulf in the rankings, holds a positive record over the American, including victories in their last two meetings - a straight-sets win at last year's Australian Open first round and more recently during this summer's grass-court swing in Berlin.
The pair traded blows from the opening exchanges, both players deploying their best weapons from the baseline.
"Paula is a tough player. I feel like I had the lead but there wasn't too much I did wrong. She stepped it up. I'm really happy to be through today," the 22-year-old said on court.
"I saw the draw. Definitely not someone you want to play in the second round. Former No.2 in the world. Great competitor. I think I need matches like this to build my confidence. I'm happy with how I managed today. There was a bit of nerves."
Fan favourite Gauff, who won here in 2023, will next face another Spaniard, Cristina Bucsa.
World No.2 Elena Rybakina put on a dominant performance to topple Spain's Jessica Bouzas Maneiro 6-2 6-4.
The Kazakh, who is looking to climb to the top of the WTA rankings with a title in New York, delivered on expectations in the night's final session at Louis Armstrong Stadium, extending her pursuit of a third grand slam crown.
"I'm really happy with this win today, in the second set she started to go for her shots but I'm happy I managed to close it out," Rybakina said on court.
Rybakina had dispelled doubts over her fitness after retiring from the Cincinnati Open in the build-up to the tournament, and she will now face Yuliia Starodubtseva in the third round, after the Ukrainian completed a comeback win over 32nd seed Maria Sakkari.
"It's true it wasn't perfect preparation at all," Rybakina said. "I was a bit upset watching everybody practice preparing for the tournament and I was just doing all possible recovery and gym. I'm super happy to be here."
Earlier, two-time champion Naomi Osaka has recovered after a mid-match lapse to advance to the third round with a 6-2 5-7 6-1 victory over Katerina Siniakova.
Osaka wore silver and white under her long white jacket with a white visor for her match in Arthur Ashe Stadium, after she was dressed in black with her hair done in cornrows under a headband in a tribute to former NBA superstar Allen Iverson for her opener at night.
The No.13 seed and winner of four grand slam titles appeared headed for a quick afternoon against Siniakova.
Osaka won the first set in 30 minutes and then opened a 4-2 lead in the second. But she then had her serve broken in a lengthy next game and eventually her level of play took a substantial dip, with 20 unforced errors in the set after only four in the first.
Osaka quickly regained control, breaking for a 2-0 lead in the third before finishing a 19-shot rally with a volley for a winner en route to taking the next game.
Swiatek, the 2022 US Open champion, had it much easier with a 6-3 6-2 victory over Nadia Podoroska.
No.17 seed Alex Eala is headed to the weekend after beating Oleksandra Oliynykova 6-1 6-4.
So is Madison Keys, but just barely, after the 2017 runner-up saved five match points before edging out Anna Bondar 5-7 6-4 7-6 (10-5).
"That was something, huh? No stress, though, we all knew I had it right?" Keys joked to the fans afterwards.