After scoring 281/5 in their 43 overs, the Proteas looked on track to beat the Black Caps, who were set a target of 298 due to the Duckworth-Lewis method after the match was interupted by rain.
South Africa managed to restore some calm after New Zealand's blistering start with four quick wickets, but all their hard work flew out the window when they let New Zealand all-rounders Grant Elliott and Corey Anderson launch a major comeback.
Anderson ended with 58, while Elliott, who hit the game-winning six, remained undefeated on 84, which came off 73 balls and included seven fours and three sixes.
"It was an amazing game," de Villiers said after the match. "We're hurting and it will take us a long time to get over this.
"We play for the people back home, hopefully the passion we showed made a difference and people can still be proud of us.
"I couldn't ask for anything more, we left it all out on the field. It is really painful – we go away with sore hearts."
De Villiers made an unbeaten 60 and was well supported by batsmen Faf du Plessis and David Miller, who scored 82 and 49 respectively, and he was frustrated with the fact that South Africa would not be tasting World Cup glory for the first time.
"My goal is to win games of cricket, to take glory home, and make a difference in the nation's heart," he said. "We didn't achieve that. We had our chances and didn't take them.
"Lots of people were supporting us. We wanted to take that trophy back home. But life moves on, the sun will come up tomorrow."