Gauff, the top seed, was two points from defeat but rallied to win 7-5, 4-6, 7-6(2) in a match lasting two hours and 55 minutes.
Gauff's performance was marked by 23 double faults and 74 unforced errors, and she described it as a “frustrating match”.
Her opponent, Danielle Collins, also produced an error-strewn performance, hitting 13 double faults and 80 unforced errors.
Gauff, who exited Wimbledon after a defeat in the first round, will now face Veronika Kudermetova in the next round of the WTA 1000 tournament, a significant hard-court event leading up to the US Open.