Gauff, 18, was the French Open runner-up and was seeded 11th at the All England Club.
Anisimova, seeded 20th, has now reached the fourth round in three straight Grand Slam tournaments.
"It was my first time playing on Centre Court," Anisimova said. "It's the most special day of my career."
Anisimova started the match by losing the first three games, before the 20-year-old's forceful baseline game eventually began to hold sway. Anisimova took that opening set to a tiebreaker, which she then led 4-1, but Gauff grabbed the next half-dozen points.. She then lost the tiebreaker despite taking a 4-1 lead.
"I think the worst thing for a tennis player is to lose 7-6 in the first set,'' Anisimova said. "I had the same experience at French Open. I think from experience it's really important to just bounce back and give everything I have.''
She didn't let it derail her. Instead, she kept taking control of groundstroke exchanges while also doing a fantastic job of handling Gauff's serve, which reached 123 mph Saturday.
After entering 2022 with a record of 11-23 in three-setters, Anisimova has gone 13-6 this season, leading the tour for the most victories in matches that go the distance.
"I think I just didn't play that well," Gauff said. "I think that wasn't really anything to do with my head. There's days like that. I've just got to practice to make sure I have less days like that."
After closing out the victory, Anisimova dropped to her back on the court, covering her face with both hands, then rose to blow kisses to the crowd and wiped away tears.
"It was a tricky match," Anisimova said. "It was very tough conditions-wise. It was constantly changing and you had to adapt every second and just be focused on what's going on.
Anisimova will next face Harmony Tan for a place in the quarterfinals.
Tan beat British wild-card entry Katie Boulter 6-1, 6-1 on No. 2 Court to reach the fourth round. She never faced a break point in the match and converted five of the 10 she earned.
"I think I like grass,'' said Tan, who has won three straight matches at a tournament for the first time in her career. "I really like to play with some slice, volley, everything with my game.''
Tan is making her debut at the All England Club. She has played at the French Open four times, reaching the second round once. She also played at this year's Australian Open, also reaching the second round there. At the US Open, she lost in the first round in 2018 in her only appearance at Flushing Meadows.
Other women's fourth-round matches Monday will be No. 17 Elena Rybakina vs. Petra Martic, and 2019 champion Simona Halep against No. 4 Paula Badosa, who got past two-time Wimbledon winner Petra Kvitova 7-5, 7-6 (4).
Kvitova hasn't been beyond the third round at a Grand Slam tournament since making the fourth round at the 2020 Australian Open.
Martic, who is ranked 80th but has been to the fourth round twice before at Wimbledon, ended American Jessica Pegula's run of quarterfinal appearances at Grand Slam tournaments this year with a 6-2, 7-6 (5) victory on No. 3 Court.
The 28-year-old Pegula, the No. 8 seed, had reached the quarterfinals at this year's Australian Open and French Open. She made it to the third round at Wimbledon for the first time.
Meanwhile, Tamara Korpatsch, the German player who criticized Tan for pulling out of their doubles match at Wimbledon, has tested positive for COVID-19 and will withdraw from her next tournament in France, she said on Instagram.
It's at least the fourth known COVID-19 case among players who competed or planned to compete at Wimbledon.
The Associated Press contributed to this report.