Zoran Zaev, the Macedonian prime minister, will now seek to take the issue to parliament where he will need a two-thirds majority to implement the constitutional changes necessary for the deal to survive.
Greece noted the "contradictory" results from the vote and said its outcome will require careful moves to "preserve the positive potential" of the deal between Athens and Skopje.
Voters began trickling in to schools and other polling stations around the country after polls opened at 7am (0500 GMT).
Zaev pledged to honor the results of the vote, despite the boycotts and the low turnout.
"That was the biggest threat to our country's future", he said.
Guterres reiterated the UN's commitment "to provide all necessary support, if required" including through his personal envoy and United Nations agencies, Haq said.
"I believe the huge majority will be in favor because more than 80 percent of our citizens are in favor of European Union and NATO", Zaev said after casting his ballot. The nationalist opposition holds 49 seats in the 120-seat parliament, enough to block the two-thirds majority required to change the constitution. However, Zaev's government says the referendum was called as a consultative move.
Allison and Tasuku Honjo Win 2018 Nobel Prize In Physiology or Medicine
The discoveries led to one of the decade's major advance in cancer therapy - drugs called checkpoint inhibitors . The method researched by the scientists have found out ways to remove the brakes on cells that fight attackers.
Although the two governments promote the deal, there are still many people in both countries opposing the agreement. Mattis has said there was "no doubt" Russian Federation funded groups inside Macedonia to campaign against the name change.
By contrast, Greek Defense Minister Panos Kammenos, the head of a right-wing populist party, said on Twitter that "68 percent of the people have canceled the agreement", a reference to the most recent turnout figures.
The agreement faces more hurdles before it can be finalized.
Macedonia's worldwide partners called for parliamentary support for the deal.
But Greek Prime Minister Alexis Tsipras faces problems of his own.
Opposition VMRO-DPMNE party spokesman Ivo Kotevski criticized the name deal as something that would force Macedonians to give up their national identity.
The vote is an emotional moment for a country that has struggled for recognition of its name since 1991, when the former Yugoslav republic declared independence. Athens argues its neighbor's name represents a territorial claim on its northern province of Macedonia.
The trailer for X-Men: Dark Phoenix is finally here!
Take a closer look at the trailer with 50 Dark Phoenix images below, and sound off with your own thoughts in the comments. While the long delay to the screen might be cause for concern, perhaps Dark Phoenix will turn out for the best.
Ninety percent of those who voted were in favour of the change, aimed at ending a dispute with Greece, which has its own region called Macedonia.
Greece's refusal to recognize Macedonia as a country has barred it from participating in worldwide groups, such as NATO and the EU.Greece insists Macedonia designate itself as "North" to differentiate the country from Greece's own province of Macedonia, the birthplace of Alexander the Great.
The deal would "contribute to regional stability, security, and prosperity", it added, among concerns that if people in the Western Balkans lost hope in European Union enlargement prospects, it could open up a hornet's nest of old hostilities - just two decades after the last Balkan wars.
But opponents, pointing to the low voter participation, described the referendum as a failure. "It is clear that the agreement with Greece has not received the green light from the people", nationalist Hristijan Mickoski told journalists.
Pro-government media have focused on the fact that the overwhelming majority of those who did vote supported the name change.
Zaev and his allied parties, which include those from Macedonia's Albanian minority, can rely on 71 MPs to vote in favour of the constitutional change required for the Republic of Macedonia to rename itself North Macedonia.
Protesters shout out slogans about boycotting the referendum on changing the country's name that would open the way for it to join North Atlantic Treaty Organisation and the European Union in Skopje, Macedonia September 30, 2018.
Advisory #4 on Tropical Storm Kirk
By weekend, northerly swells generated by Post-Tropical cyclone Leslie, are expected to propagate southwards across our area. A hurricane is a tropical cyclone that has maximum sustained surface winds of 74 miles per hour or greater.
Critics of the pact, including President Gjorge Ivanov, had called for Sunday's vote to be boycotted.