In another surprise, CoCo Vandeweghe also reached the round of eight by defeating US compatriot and sixth-seed Jessica Pegula 6-4 3-6 6-4.
Fourth-seeded Ons Jabeur, whose match was suspended Wednesday because of rain and lightning with her leading 6-3 5-2, returned on Thursday to win the one game and finish off Emma Navarro.
Sabalenka had won her first match in nearly six weeks here Wednesday and took the opening set without too much of a struggle.
But the 20-year-old Anisimova, who is ranked 47th in the world, found her rhythm after the break as Sabalenka began to make mistakes.
Sabalenka had two straight double faults to trail 5-3 and Anisimova was able to serve out the set.
Anisimova continued her run in the deciding set, breaking Sabalenka's serve twice for a 4-0 lead. Sabalenka made it 5-4, but Anisimova closed out the match with her sixth ace and improved to 3-0 against the world's fifth-ranked player.
Anisimova was thrilled with her third match victory in as many days. She'll face Vandeweghe on Friday to reach the semi-finals.
"It's a pretty good result, like in the quarter-final, and especially against a top seed," Anisimova said. "It's a big confidence boost."
Jabeur, of Tunisia, had hoped to squeeze in more tennis and wrap up the match on Wednesday.
She only needed a few minutes - and four points - to finish off Navarro. Jabeur has a third-round match with Irina-Camelia Begu of Romania later on Thursday.
The tournament has been affected by bad weather all week and Thursday was no different. Afternoon matches were suspended for close to two hours as a storm passed through the Daniel Island facility.
However, conditions are expected to improve and dry out on Friday through to Sunday's championship match.