Spain beat Turkey for the second spot. New Zealand and Spain will replace Australia and Luxembourg.
New Zealand's mission to the United Nations hosted celebrations in an Irish bar to thank supporters.
"You can't win something like this without the countries in your own region and a lot of other champions around the globe doing a lot of stuff," said Mr McCully, "so we had a few drinks with those who were able to turn up."
He wanted everyone involved in the campaign to have some time off and then it would be heads down in preparation to take up the seat - which would require no extra funding to the Foreign Affairs budget.
The Ministry of Foreign Affairs and Trade had been working for the past year on policy issues that could arise and which members would expect to be across if it won a seat.
New Zealand ambassador and permanent representative to the United Nations, Jim McLay, sat beside Mr McCully when the result was announced and put his head in his hands with relief.
Mr McCully said Mr McLay would take New Zealand's seat at the Security Council on January 1.
"There is no debate about it."
Mr McCully himself has emphatically dismissed speculation that he was ever after the post telling a reporter in June: "I would rather saw off my arm with a rusty screw driver than be an ambassador anywhere."
But he did say that he and Prime Minister John Key would probably chair some sessions of the council - most likely in the month that New Zealand will get to chair the council in the second half of the year.
Mr Key said the win was a victory for the small states that made up half of the UN membership.
He also said New Zealand would do on the council what it said it would do for small countries: "Firstly listen to them, secondly stand up for their issues, be an example of a small country that can actually have a loud voice, and most of all be part of decision-making process that leads to peace and stability of the world."
New Zealand has been a harsh critic of the way the Security Council operates, not just over the veto of its five permanent members, but over the fact that decisions can be taken in a region without the requirement to consult countries.
"We are going to be charged with trying to make sure the Security Council is able to be relevant on a topic that requires Security Council attention when so many times in the last few years it has been simply ... paralysed particularly by the use of the veto."
"If we are disappointed at the way the Security Council works, then we can't change that and we can't improve it without being prepared to frustrate our friends occasionally," Mr Key said.
"Being respectful and professional in the way in which you manage differences is the key to this business."
He said some people believed New Zealand had a problem managing its relationships in the regions with China and the United States. "That is something we do every day."
Labour foreign affairs spokesman and former UN worker David Shearer helped to campaign and yesterday congratulated Mr McCully but said he had to honour commitments.
"New Zealand will need to follow through on what it promised: to listen to the issues carefully and give each country's perspective a fair hearing, to decide situations on the merits, not because they are backed by powerful interests and to stand up for small states who often don't get a voice at the Security Council."
New Zealand's reputation in the world was enhanced in 1994 when it was last on the council and demanded greater international action during the genocide in Rwanda.