Rabada returned figures of 8.2-0-25-6 as Australia, chasing 231 for victory, lost its last seven wickets for 54 runs to be bowled out for 150 in 42.2 overs.
South Africa will now clash with Pakistan on Saturday in the title clash.
Rabada dismissed the top three batsmen to leave Australia reeling at 33 for three, and then returned to rip the heart out of the Australia middle and lower middle-order with some very fast, aggressive and accurate bowling.
The two batsmen put on 66 runs for the fourth wicket in about 22 overs. The partnership ended when Rabada brought off a smart catch at mid-off to dismiss Gregory.
More From This Section
Both the batsmen fell to Corbin Bosch who finished with impressive figures of two for 25.
Earlier, South Africa survived a middle-order collapse to post a competitive total on the board.
Wicketkeeper-opener Clyde Fortuin hit a classy 74 and captain Aiden Markram scored a polished 45 as the two batsmen put on 105 runs in less than 21 overs for the first wicket.
Fortuin, who later excelled behind the stumps by bringing off three smart catches, hit eight fours in a 92-ball innings. Markram, who fell to a spectacular catch by Guy Walker in the gully, hit four fours in a 63-ball 45.