A total of 248 members of the National Assembly, the lower house of parliament, voted in favor of the non-binding motion, while 91 lawmakers opposed it.
The motion was tabled by the opposition party Economic Freedom Fighters, and was backed by the ruling African National Congress.
The parliament said the measures will be in place until Israel agrees to a ceasefire and participates in UN-facilitated negotiations.
The vote came after Israel recalled on Monday its ambassador to South Africa, Eliav Belotserkovsky, "for consultations."
Also on Tuesday, South African President Cyril Ramaphosa chaired a BRICS extraordinary virtual summit on the Palestinian-Israeli issue.
South Africa announced last week that it had referred Israel to the International Criminal Court (ICC) for war crimes investigation. Its cabinet also called on the ICC to issue arrest warrants for all those involved, including Israeli Prime Minister Benjamin Netanyahu.
Earlier this month, South Africa recalled all of its diplomats from its embassy in Israel.