Ukrainian Kozlova had taken the first set 6-4, but after 15-year-old Gauff responded in kind to force a decider, the world No 83 withdrew after going a break down.
Gauff, who beat Stefanie Vogele in the first round barely an hour after entering the tournament as a lucky loser, faces either top seed Kiki Bertens or Misaki Doi for a place in the semis.
The victory also means Gauff will break into the world's top 100 for the first time, three months on from her remarkable run to the second week at Wimbledon.
WTA Charleston, SC
Barty battles past Rogers into Charleston quarters, Muguruza, Kvitova out
09/04/2021 AT 08:27
There was also progress for top seed Kiki Bertens, who is competing in the Austrian tournament for the sixth straight year, who defeated Misaki Doi in straight sets 6-4, 7-5.
The two exchanged breaks in the opening two games of the match, but the Dutchwoman took control when she went 4-3 ahead in the first set.
The second followed a similar pattern, with two breaks at the start, and Bertens finally got the win she broke to take a 6-5 lead before serving it out.
Anastasia Pavlyuchenkova, a former champion in Linz, also got off to a winning start, downing Barbara Haas 6-3, 6-3.
Earlier in the day, 2017 French Open champion Jelena Ostapenko made light work of Tamara Korpatsch to book a second-round meeting with Alize Cornet.
Ostapenko broke her German opponent six times en route to a simple 6-1 6-3 victory in 73 minutes.

Oops! Ostapenko lets go of her racket during serve

Eighth seed Ekaterina Alexandrova recovered from a set down in emphatic style, winning 12 of the next 13 games against Kristyna Pliskova to win 3-6 6-0 6-1.
Alexandrova faces Laura Siegemund in the next round.
WTA Charleston, SC
Muguruza, Kvitova ease through to last-16 in Charleston
07/04/2021 AT 08:49
Australian Open
Classy Svitolina beats Gauff in straight sets to progress
11/02/2021 AT 08:40