Seven countries -- Guatemala, Honduras, Togo, Micronesia, Nauru, Palau and the Marshall Islands -- joined Israel and the United States in opposing the measure.
Among the 35 countries that abstained were Argentina, Australia, Canada, Croatia, the Czech Republic, Hungary, Latvia, Mexico, the Philippines, Romania and Rwanda.
Ukraine, which supported the draft resolution at the Security Council, was among 21 countries that did not turn up for the vote.
The measure was sent to the General Assembly after it was vetoed by the United States at the Security Council on Monday, although all other 14 council members voted in favor.
"The United States will remember this day," US Ambassador Nikki Haley told the assembly.
"America will put our embassy in Jerusalem," Haley said. "No vote in the United Nations will make any difference on that.
"But this vote will make a difference on how Americans look at the UN and on how we look at countries who disrespect us in the UN," she said.
"When we make generous contributions to the UN we also have a legitimate expectation that our goodwill is recognized and respected."
According to Bashir Ahmad, the New Media aide to President Buhari, Nigeria voted in favor of the UN call for US to withdraw decision to recognize Jerusalem as Israel’s capital.
While resolutions by the General Assembly are non-binding, a strong vote in support carries political weight.
Israel seized the largely-Arab eastern sector of Jerusalem during the 1967 Six-Day War and later annexed it, claiming both sides of the city as its "eternal and undivided capital."
But the Palestinians want the eastern sector as the capital of their future state and fiercely oppose any Israeli attempt to extend sovereignty there.
Several UN resolutions call on Israel to withdraw from territory seized in 1967 and the resolution contains the same language as past motions adopted by the assembly.