Eighty-one deputies in the 120-seat parliament voted in favor. Representatives of the opposition VMRO-DPMNE, who opposed the agreement with Greece, boycotted the vote.
The countries struck the deal on the new name in June, but Macedonia will start using it only after the parliament in Athens also ratifies the agreement.
Greece blocked its neighbor's aspirations to EU and NATO membership over the use of 'Macedonia', which it said implied territorial claims to a Greek province of the same name.
At the start of the parliamentary session, Prime Minister Zoran Zaev told deputies the name change would "open the doors to the future, Macedonia's European future", and to joining the North Atlantic alliance.
Several hundred people have protested against the deal in front of parliament over the past three days.