Steyn (5-25) derailed Pakistan in the 47th over with the wickets of Umar Akmal (22), captain Misbah-ul Haq (65) and Saeed Ajmal (0) to wreck the opposition from 228-5 to 238 all out in 49.2 overs.
South Africa's win gave them an unassailable 3-1 lead in the five-match series ahead of the fifth and final match in Sharjah on Monday.
South Africa won the first match by one run in Sharjah and third in Abu Dhabi by 68 runs while Pakistan claimed the second match in Dubai by 66 runs.
Misbah, along with debutant Sohaib Maqsood (56), put Pakistan in charge but Steyn removed Maqsood in the 37th over to give his team a sniff of the victory.
Also Read
When Misbah holed out, after hitting four boundaries and a six off 76 balls, Pakistan's hopes were suddenly dashed.
"I am very happy and proud of the boys with this series win away from home, especially after a really bad show in Sri Lanka," said South Africa captain AB de Villiers whose team lost their last series 4-1 in Sri Lanka in July.
Misbah said Steyn's devastating over had changed the game.
"We were in a good position until the last five overs. We had two set batsmen and the equation was 30 balls, 41 runs which was gettable but Steyn's over put pressure on us," said Misbah.