The world number one, who is seeking a maiden trophy in the event since a run to the final three years ago, finished top of the Steffi Graf Group and next takes on Amanda Anisimova in a rematch of their US Open title clash.
American Pegula takes on in-form Kazakh Elena Rybakina, who qualified for the last four as the best player from the Serena Williams Group.
Gauff's erratic serve had been a concern after her opening defeat by Pegula, but it was the 21-year-old's aggressive return game that stood out against Sabalenka as she broke to start the match and went 4-2 up at the King Saud University Sports Arena.
Sabalenka let out a scream after she saved break points and held for 3-4 in the rematch of the French Open title clash that she lost, and the fired-up Belarusian soon broke to draw level at 5-5 with a neat forehand winner.
Sabalenka showed more fight in the tiebreak to come from behind and take the first set, and there was no stopping the 27-year-old when she eased to a 4-0 lead in the second set.
Breezy win
Earlier, Pegula secured a breezy 6-2, 6-3 victory over the already-eliminated Jasmine Paolini and said she would work out a strategy for her next opponent despite knowing there was a slim chance of an exit if Gauff prevailed in three sets.
"We're going to be really happy with today, for the rest of the day and maybe for most of the night, and then we're going to have to switch strategies a little bit because it's a quick turnaround now," said Pegula.
"We'll be ready for the next opponent."
Pegula gained the upper hand, winning five out of the first six games after Paolini faltered on her serve early, before the 2023 runner-up took the first set, giving her Italian opponent no chance.
Paolini withstood some powerful baseline hitting in the next set to hold in the opening game but Pegula continued to heap on the pressure and broke for the third time in the contest, paving the way for a comprehensive victory.

"Today I finally got a straight-sets win for the first time in like a few months," Pegula said.
"That always feels really good. I thought I served well, just played solid and was aggressive when I needed to be. There weren't any negative notes today."
