"I thought I'd give her a crack and reeled her in and we ran together for a bit before [I] broke away around 28km.
"I had the feeling it could be my day but you never know in a marathon. I was just trying to get a personal best so to get the win, a record and the national title - it's unbelievable and amazing, I'm so stoked."
Williams, who has been running for seven years is self-coached and follows the Lydiard methods and principles in training.
Earlier this year she finished ninth at the Gold Coast marathon in 2h 45m 19s.
Gibbs, 49, New Zealand masters record holder, found the second half tough going, finishing second in 2h 46m 14s, 33s ahead of Keem.
"It was harder than I had expected; it wasn't a very sparkling marathon but overall I'm pretty happy. Three weeks ago I was on the verge of not doing it. I had a few niggles and I missed some of the quality training," Gibbs said.
"Alex ran a really good race, so I take my hat off to her."
Shireen Crumpton of Otago, winner in 2010, was fourth in 2h 52m 18s and third in the New Zealand championship.
Robertson won the half marathon in 1h 17m 28s, just over a minute ahead of last year's winner Danielle Ingram-Trevis.
Maria Bentley was third in 1h 20m 49s.
Women's Marathon
1st: Alexandra Williams (Christchurch) 2h 41m 28s
2nd: Sally Gibbs (Katikati) 2h 46m 14s
3rd: Anita Keem (Australia) 2h 46m 47s