The former Oympic champion, who gave birth to her daughter Bella in April last year, won 69 per cent of her first-serve points and broke the former US Open champion three times during a match lasting two hours 20 minutes.
In the tightly-contested third set, it was Bencic who struck first as she came back from 0-40 down to break Gauff for a 5-4 lead and closed out the victory on her first match point when the top-ranked American ripped a forward long.
"Obviously, this is why you are practicing and working hard all your life, so it's super nice to play in this kind of atmosphere," Bencic said in her on-court interview.
"The way you cheered before the match ... I had chills and goosebumps and I kind of just put the serve into the court because I was so nervous."
Gauff started aggressively and committed five double faults in the first set, including three in one game, but was only broken once en route to wrapping it up in 51 minutes when Bencic sent a forward wide.
But Bencic was firing on all cylinders in the middle set and, despite twice requiring medical attention for foot and hand issues, built a 4-1 lead before securing it when Gauff returned a serve into the net.
Bencic took another medical timeout before the decider to have a hand blister tended to.
The Swiss awaits the winner of Thursday's clash between Australian Open champion Madison Keys, the fifth seed, and Croatian 19th seed Donna Vekic.
Women's top seed Aryna Sabalenka will face Britain's Sonay Kartal seeking a win that would set up a quarter-final with either Jasmine Paolini or Liudmila Samsonova.