The 27-year dispute has led to frequent disagreement and protests, but the two countries agreed on the new title of the former Yugoslav republic after months of intensive diplomacy.
Greece has long objected to its northern neighbour being called Macedonia because it has its own northern province of the same name.
Macedonia hopes that resolving the name dispute will help clear the way for it to join the European Union and NATO.
The deal still needs to be approved by the Macedonian and Greek parliaments.
Greek officials earlier said the list of potential names included "New Macedonia" and "Upper Macedonia", but after months of discussions "North Macedonia" was chosen. Greek Foreign Minister Nikos Kotzias had prepared a 20-page draft agreement after repeated talks with his Macedonian counterpart Nikola Dimitrov.
Kotzias told Kontra TV on Monday that the agreement would specify that Macedonia's language is of Slavic origin.
"It's clear that (Macedonia) bears no relation to the ancient (Macedonian) culture... and that their language belongs to the Slavic language," he said.
"There is a need for a wider national consensus to find a solution that won't hurt the dignity of the Macedonian people and citizens," said Ivanov.
He is close to a nationalist party which was defeated by Zaev in elections last year.
Greece's parliament will be called to ratify the agreement after Macedonian lawmakers approve it, provided that Skopje fulfils preliminary EU and NATO requirements to begin membership talks, Kotzias said.
Skopje hopes to secure a date to begin accession talks at an EU summit in late June, and an invitation to join NATO in mid-July.
"This historic agreement is testament to many years of patient diplomacy, and to the willingness of these two leaders to solve a dispute which has affected the region for too long," NATO Secretary General Jens Stoltenberg said in a statement.
"This will set Skopje on its path to NATO membership. And it will help to consolidate peace and stability across the wider Western Balkans," he added.
Athens has long objected to its neighbour's constitutional name -- the Republic of Macedonia -- because it fears it could imply territorial ambitions. Ancient Macedonia was the cradle of Alexander the Great's empire, a point of pride to Greeks today.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)