Swiatek, who counts the 2022 US Open among her five grand slam titles, converted three of six break-point chances but also racked up 41 unforced errors en route to securing the victory in one hour, 52 minutes at Arthur Ashe Stadium.
The top-seeded Pole built a 4-0 double break lead and looked poised to run away with an easy win, but Rakhimova consolidated a break to get back to 4-3. However, Swiatek went on to seal the first set with her third love hold of the match.
Swiatek took a 3-1 lead in the second set but showed signs of frustration as shots went off target and Rakhimova refused to back down from the challenge.
The world No.1 had a chance to serve out the match but Rakhimova broke to get to 5-5 as the second set went to a tiebreak. There the Pole saved three set points before edging through to the second round and a meeting with Ena Shibahara.
"At the beginning (I felt) good but then I got a little bit tight and my opponent used it so I was trying to get back to my game," Swiatek said.
"I've just been trying to adjust to the courts. I haven't practised a lot so this time I just wanted to feel how it is on Arthur Ashe and I'm pretty sure day by day I am going to get more and more rhythm."
In other action, Japan's Naomi Osaka beat 10th seed Jelena Ostapenko 6-3 6-2 on Louis Armstrong Stadium in a rare first-round clash between former major champions.
A laser-focused Osaka held serve throughout and fired nine aces in a surgical takedown to kick off her return to Flushing Meadows following a maternity leave year off in 2023.
Miscues including six double faults and 21 unforced errors plagued an uneven performance by the hard-hitting Latvian.
A back-and-forth first set turned in Osaka's favour as Ostapenko hit a cross-court backhand into the net in the eighth game, earning the four-time major winner the first of her three service breaks.
Former world No.1 Osaka gave a friendly New York crowd a glimpse of her past dominance in the second set as she blasted three straight aces to claim the fourth game.
Ostapenko fought off two match points before Osaka slammed the door with a blistering cross-court forehand winner, setting up a second-round bout with Karolina Muchova.
Earlier Danielle Collins' last outing at her home major ended in an early exit as fellow American Caroline Dolehide recovered from losing the first set to knock out the 11th seed 1-6 7-5 6-4 and set up a second-round match against Italian Sara Errani, who beat Spain's Christina Bucsa 3-6 6-0 6-4.
British No.1 Katie Boulter, Alex de Minaur's partner, came from a set down to defeat Aliaksandra Sasnovich 5-7 6-2 6-1 on the same court the Australian men's No.1 was later due on.
Former world No.1 Caroline Wozniacki outclassed Japan's Nao Hibino 6-0 6-1 and three-time losing finalist Victoria Azarenka beat Yulia Starodubtseva, but 2017 champion Sloane Stephens lost to Clara Burel.Â
with agencies