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.
Wimbledon
Anisimova rallies from a set down to stun Gauff and reach fourth round
3 HOURS AGO
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.
Wimbledon
'A real inspiration' - Schett and Wilander hail 'pioneer' WTA stars
5 HOURS AGO
Wimbledon
Gauff into round three after impressive win over Buzarnescu
YESTERDAY AT 20:56