Gauff led 3-0 at the outset, then 5-3, and held a total of five set points in the opener but failed to convert any.
Krejcikova took advantage, grabbing that set by taking the last four points of the tiebreaker. She then reeled off 15 consecutive points during one stretch en route to a 5-0 edge in the second set.
Closing out the most important victory of her singles career was not easy, though: Krejcikova needed six match points to do it, raising her arms overhead when she finally won as Gauff sent a forehand wide.
Krejcikova, from the Czech Republic, has won two Grand Slam doubles titles with Katerina Siniakova -- and they're into the semifinals in Paris -- but is playing in only her fifth major tournament in singles and only once before had made it as far as the fourth round playing solo.
"Everybody, they just put a label on me like, 'Yeah, you play doubles. You are a doubles specialist.' But I never thought I just want to be a doubles specialist," Krejcikova said.
"So I was just working hard all the time. I just wanted to play singles. It was really, like, frustrating that I just wasn't able to get there," she said. "But I always felt ... sooner or later, I'm just going to get there."
She is currently ranked a career-high 33rd and on a 10-match winning streak in singles.
Krejcikova ended the nine-match run of the 24th-seeded Gauff, who is based in Florida and was the youngest French Open quarterfinalist since 2006. Gauff's 41 unforced errors included seven double faults -- and after one, she mangled her racket frame by whacking it three times against the ground.
"My hitting partner told me this match will probably make me a champion in the future," Gauff said. "I really do believe that."
On Thursday, Krejcikova will face No. 17 seed Maria Sakkari of Greece, who ended defending champion Iga Swiatek's 11-match and 22-set winning streaks in a later match to reach the semifinals of a major tournament for the first time.
All four women remaining in the field are making their Slam semifinal debuts. Sakkari and Krejcikova are both 25. Each has won only one tour-level title.
Sakkari used strong and steady baseline play to eliminate Swiatek 6-4, 6-4 at Court Philippe Chatrier in the quarterfinals and ensure that the clay-court tournament will end with a new Grand Slam champion.
"I couldn't have done it without my team and their support and I just want to thank them, and we still have a long way to go, of course," Sakkari said, "but we made a huge step today."
Swiatek said she was "stressed" coming into the match, in part because of the intensity of her season. The French Open is her eighth tournament of the year, and she was looking for her third title in that stretch, having won in Adelaide and Rome. Wednesday marked her 29th singles match.
"I think, like, [the] past couple weeks hit me, kind of, yesterday," Swiatek said. "I just didn't have good days; I couldn't do, like, physical recovery well because I was stressed. Days like that happen, and it's normal."
Swiatek is also playing doubles in Paris with Bethanie Mattek-Sands -- their third tournament together this season -- and their third-round match Sunday lasted over three hours. They play in the semifinals Friday.
"I played many of the tournaments, more than in my previous seasons," Swiatek said. "I'm happy with the results that I have, but also I'm constantly at work. For sure we're going to try to chill down, chill out a little bit, cool down, also find some perspective.
"Yeah, basically when I close my eyes, I only see tennis court and balls, so it's pretty tiring."
Gauff vs. Krejcikova began in the late morning with the temperature in the low 70s Fahrenheit, a blue sky and no wind.
After the number of fans in the 15,000-seat main stadium was capped at 1,000 for each of the first 10 days of the tournament because of COVID-19 restrictions, that limit was raised to 5,000 on Wednesday. And those in attendance were loudly pulling for Gauff, who burst onto the scene at Wimbledon two years ago by reaching the fourth round.
Cries of "Allez, Coco!" ("Go, Coco!") greeted her winners. Loud clapping of encouragement preceded her service games.
The contrast was striking when Krejcikova broke back on her way to pulling even at 3-all, when only a smattering of polite applause was heard.
Swiatek, a 20-year-old from Poland who has looked untouchable on clay, jumped out to a 2-0 lead, but then Sakkari took over, collecting eight of 10 games. When Sakkari smacked a backhand winner down the line to close a 15-stroke point that claimed that set, she leaned over and punched the air with her right fist.
That ended Swiatek's set streak at Roland Garros, which dated to the beginning of last year's tournament, when she dropped only 28 games in all. She had lost only 20 games this year through four matches.
But Sakkari, who also beat 2020 French Open runner-up Sofia Kenin, used clean strokes -- accumulating 26 winners, nine more than her opponent -- and a strategy of serving to Swiatek's forehand to gain control.
Down 2-0 in the second set, Swiatek took a medical timeout and left the court with a trainer, returning with her upper right leg taped up. During the break, Sakkari tried to stay warm by hopping and skipping side to side behind the baseline and did not lose a beat when play resumed.
"Right now I know it's nothing serious," Swiatek said after the match. "When I was on court, I felt it totally differently. As I said, I couldn't even sleep well yesterday. I slept, like, few hours. I think I was feeling everything twice as much as I should. It was hard to rationally just see what's going on."
The Associated Press and ESPN's D'Arcy Maine contributed to this report.