Swiatek won 6-2 7-5 to set up a third-round clash with Belgian Elise Mertens, a 6-4 6-1 winner over American Peyton Stearns.
Swiatek beat Garcia in straight sets at the same stage in Indian Wells where the Pole's title defence ended last week in the semi-finals, but faced a much more determined opponent this time around.
Swiatek powered through the first two games of the match without dropping a point and then consolidated another service break for a 4-0 lead before leaning on her serve to secure the first set in 29 minutes.
But the Pole faced much more resistance during a back-and-forth second set as she overturned a 3-1 deficit and then saved a set point while serving at 5-4 down as she closed out the match by winning the last three games.
Australian hope Kimberly Birrell bowed out to No.23 seed Marta Kostyuk in three sets.
But the 26-year-old made the Ukrainian fight all the way for her 7-5 4-6 6-3 victory. Â
The two went blow for blow but the big difference was Kostyuk converting seven of her nine break-point opportunities while Birrell, who had 13 chances of her own, managed five breaks only.
Former US Open champion Emma Raducanu advanced with a 7-6 (8-6) 2-6 7-6 (7-3) win over No.8 seed Emma Navarro.
Raducanu fought back from the brink to seal her first win against a top-10 opponent in eight months.
The British No.2 and world No.60 was a point away from trailing 4-1 in the final set but overcame fatigue to win a titanic struggle.
Among the other women advancing were Spanish 10th seed Paula Badosa, Czech 15th seed Karolina Muchova and No.4 seed Jess Pegula.