The US has not confirmed Zelensky's comments, and a US official told the BBC "many ideas continue to be discussed but any final deal will have to be agreed to by both parties".
The Ukrainian leader's comments came after US envoys met Russian President Vladimir Putin and Zelensky as part of US efforts to end the war between Russia and Ukraine.
Kyiv has long sought membership of the military alliance, but this has previously been opposed by the US and others while Russia has said another Nato member on its border is unacceptable.
Russia launched a full-scale invasion of Ukraine in February 2022. It controls most of the industrial region of Donbas and Zelensky has consistently said Ukraine is unwilling to give up sovereign territory.
"The Americans raised a question: 'What if Ukraine joins Nato? Would Ukraine withdraw from Donbas?' This was the first time this had been raised," Zelensky said in remarks released by his office on Saturday.
He went on to say that if he received a specific proposal that contained security guarantees, no constraints on Ukraine's military and funds to rebuild the country, he would put it to a referendum.
US envoys Jared Kushner and Steve Witkoff travelled to the Irish capital, Dublin, on Thursday to meet Zelensky, after a round of talks with Putin in Moscow.
Comments by both Putin and Kremlin officials suggest that Russia's position on the war has not shifted. It has previously proposed limits on the size of Ukraine's military, territorial concessions and Kyiv's guaranteed neutrality as conditions of a peace deal.
Ukraine has rejected these, arguing that such constraints would hamper its ability to stave off any future invasion.
Other Nato members apart from the US are wary of membership for Ukraine – and it is understood that Ukraine itself sees that as unrealistic.
The Kremlin has always been fiercely opposed, too. It is one reason why Russia started this war in the first place.
It is possible the American envoys were exploring Ukraine's "red lines" when it comes to occupied land in the Donbas. Zelensky said recently that the US mediators believed Kyiv only had to cede territory to achieve peace and were applying pressure, keen to do a deal as soon as possible.
Ukraine is sure that Russia's ambitions are far greater and has long seen Nato as its only sure protection.
So it is also possible that Zelensky made this suggestion public in order to re-open a discussion that had been considered all-but closed.
He maintains that the idea is now "back on the agenda" as part of an "extremely difficult conversation" on European security.
It also looks like Ukrainian push-back against Russia's renewed hardline stance. Moscow now talks about a "new European security architecture", which is long-standing Russian code for a weaker Nato.
The issue appears to have been the main focus at the latest round of talks between Ukraine, Russia and the US in Abu Dhabi this week.
Hours after Zelensky's remarks, Jared Kushner appeared keen to dampen down any US offer of Nato membership for Ukraine, urging "confidentiality" in a sensitive process.
He said that "maximalist" proposals had been reported from the negotiations, along with "strong political rhetoric".
In what read like a reproach to Kyiv, Kushner referred to "private discussions" aimed at exploring new ideas about ending what he called a "horrible war".
He said the hope was that those ideas might lead to new proposals or breakthroughs.
Russia currently occupies roughly a fifth of Ukrainian territory, including most of the Donetsk and Luhansk regions that compose the Donbas.
It has insisted again that it will not agree to a ceasefire until a final peace deal is in place that would include Ukraine ceding control of those parts of the Donbas Russian troops have not captured, in addition to the Crimean peninsula Moscow annexed illegally in 2014.
The latest round of talks come after a period of fraught relations between Kyiv and Washington over Ukrainian strikes on oil facilities deep inside Russia, which Trump had asked Ukraine to pause to facilitate the supply of Russian diesel to ease global fuel prices.
Zelensky then accused US officials of limiting Ukraine's Starlink internet service, which it uses to co-ordinate defensive operations, while Trump said it was "time for Ukraine to get a new president" and called for fresh elections.
Elections are suspended while Ukraine remains under martial law, but Zelensky has previously said he was willing to hold them within months of a peace deal being reached and would give up the presidency in exchange for Nato membership.
Rosenberg: Uncompromising Putin ups demands for peace with Ukraine
US envoys meet Zelensky in Dublin after talks with Putin in Moscow
Fox Style News Syndicate. Sourced from broadcast reporting: Read Full Source Coverage.