Rauf, who was bowling his 10th and final over of his spell, bowled a good length delivery. Ngidi looked to flick but got a leading edge.
Rauf dived forward, managed to get his left hand underneath the ball and grabbed a one-handed blinder to take the crucial wicket.
South Africa defeated Pakistan by one wicket in a thriller to edge closer to the semi-finals. With this win, the Proteas have gone top of the points table.
Cricket World Cup crisis for Team India: Hardik Pandya’s injury casts doubt on his 2023 world cup journey
Chasing 271 to win, South Africa reached their target with 16 balls to spare when tailender Keshav Maharaj hit a boundary off spinner Mohammad Nawaz.
South Africa now have five wins and one defeat from six games.
Pakistan have lost four matches in succession after winning their first two but remain in semi-final contention.