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.
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 appeared headed for a quick afternoon against Siniakova, who is ranked No.1 in women's doubles but not as strong in singles as a player such as Osaka, who has won four grand slam titles.
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, appearing more relieved than excited by her nice touch.
"The match was definitely really tough and I don't know, I just felt like I had to fight," Osaka said.
"I definitely had a couple opportunities in the second set and I think I was a little bit too hard on myself. So I took the bathroom break, regrouped a little, came back and just tried to have no regrets."
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.