It was the second mass beaching in the region in a month.
"More whales are still coming in. Pilot whales have very strong social bonds and they try to help each other so more keep getting stuck," said Mark Simpson of Project Jonah, a charity that protects marine mammals.
The Department of Conservation's operations manager on Spirits Bay beach, Patrick Whaley, said officials had already euthanized some of the weakest and most stressed animals.
Rough weather and sea conditions at Spirits Bay meant the survivors will have to be taken by road about an hour south to Rarawa Beach on Thursday morning where they will be refloated.
"They will be lifted up with big nets on to the back of trucks with straw or hay loaded on them," Simpson said.
Department of Conservation area manager Jonathan Maxwell said at least 25 of the animals were already dead when officials arrived at Spirits Bay, and another 15 had died by nightfall. In addition to the 40 still alive and stuck on the beach, another 50 were spotted just offshore, he said, though some of them had since beached.
Volunteers from Far North Whale Rescue, conservation officials and the local Maori community planned to stay at the beach overnight to help keep the whales alive, Maxwell said.
In mid-August at nearby Karikari Beach, 58 pilot whales stranded. Despite hundreds of helpers fighting to save them, just nine were eventually floated off the beach and returned to the sea.
New Zealand has one of the world's highest rates of whale strandings, as they pass by on their way to breeding grounds from Antarctic waters. Scientists so far have been unable to explain why whales become stranded.
In December 2007after being stranded on Colville Beach. Conservation workers managed to coax 43 others back out to sea.
Since 1840, the Department of Conservation has recorded more than 5,000 strandings of whales and dolphins around the New Zealand coast. Scientists have not been able to determine why whales become stranded.