Provisional results released by the French Government show 53.26% of people voted ‘no' in Sunday's independence referendum, while 46.74% cast their ballot for ‘yes' - with just 10,000 votes separating the two sides.
It was a stronger result for the ‘yes' camp than the previous referendum in 2018, where 43.33% of voters supported independence, the Australian Broadcasting Corporation reported.
A higher than expected voter turnout had long queues outside some polling booths, with some people waiting up to an hour to cast their vote.
An increase in voter participation by more than 4% compared to 2018 seemed to favour the ‘yes' campaign, with a rise in the pro-independence vote corresponding with a rise in voters in most districts.
Ethnic and geographic divisions persisted in this year's vote, with regions with a higher population of indigenous Kanak favouring independence, as was the case in 2018.
Meanwhile, in areas with a higher concentration of people with European descent, people were more likely to vote to remain with France.
As results were announced late on Sunday, pro-independence leaders and their supporters burst into celebration in apparent defiance of their loss.
"My first reaction is one of great joy," said Aloisio Sako, a pro-independence leader, pointing to a four-point increase in the ‘yes' vote compared to 2018.
"Once again we have progressed. For us this is like a victory."
In the ‘no' camp, at a bar overlooking the marina in a chic part of capital Noumea, more modest celebrations were under way among anti-independence voters.
They gathered under French flags to applaud a second vote in their favour.
"I'm positive with this result of the vote, because I'm aware the majority of Caledonians wish to remain with France," said anti-independence politician Carl N'Guela.
"I'm satisfied with the result."
Sunday's vote is the latest step in a long journey toward New Caledonia's decolonisation, that was first triggered more than 30 years' ago when the territory fell into a bloody civil conflict between pro-independence activists, French loyalists, and the French state.
It is the second of three possible independence referenda as outlined by a 1998 peace deal called the Noumea Accord.
If approved by a majority in congress, New Caledonia will hold the third and final referendum by 2022.