Gayford, the partner of Prime Minister Jacinda Ardern, tweeted a picture of himself keeping the predator at bay while a dolphin swims in the background.
However, instead of launching a Flipper-style rescue to chase off the shark, Gayford said the dolphin was content to watch the underwater drama unfold from a distance.
"So it turns out that not only do dolphins not help, they actually quite like watching," he tweeted. "A childhood myth is ruined."
Gayford, who hosts a television fishing show, said he was helping a camera operator shoot footage for the educational show Young Ocean Explorers when the incident occurred.
He said he was "swimming safety", or keeping watch so the cameraman could concentrate on filming bottle-nosed dolphins and false killer whales off Great Barrier Island near Auckland.
"They were feeding on kingfish and had been tearing some large ones in half and putting blood in the water, which attracted several large bronze whaler sharks," Gayford told AFP.
"I got in the water and they turned their attention on me, I had to fend the large one pictured off with a pole several times, as it was getting quite agitated.
It is not Gayford's only recent encounter with a shark.
In March, he tweeted a picture of himself with "an overly amorous whale shark" that he said accidentally pinned him against a boat.
Gayford will soon swap his deep-sea adventures for the role of stay-at-home dad when Ardern gives birth to the couple's first child, due on June 17.
Ardern plans to take six weeks maternity leave then resume running the country.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.) Click for more trending news