The 38-year-old Williams, who said she would donate all her prize money to Australian bushfire relief funds, and good friend Caroline Wozniacki were beaten by American duo Asia Muhammad and Taylor Townsend 6-4 6-4.
The result meant that Wozniacki was unable to complete her own fairytale farewell to a tournament with which she has become synonymous, having played in New Zealand's largest city every year since 2015.
The 29-year-old Dane, who was beaten by Pegula in the singles semi-finals, is retiring after the Australian Open, which runs from Jan 20 to Feb. 2.
What will Roland-Garros postponement mean for tennis calendar?
"I have loved coming back here," Wozniacki said after tournament organisers made a special presentation before the doubles trophy was given to Muhammad and Townsend.
"Serena, thank you playing doubles with me, it has been so much fun and the only regrets I have is that we didn't do this sooner.
"I have had such a blast and it is rare that I have this much fun on court and it was a really fun way to finish off in Auckland."
Williams' singles victory, however, gave the American her 73rd WTA title and broke a near three-year drought, despite having appeared in five finals since she clinched her 23rd Grand Slam crown with a win at the Australian Open in 2017.
She is chasing Australian Margaret Court's record 24 Grand Slam singles titles, but has lost two Wimbledon and two U.S. Open finals since her 6-4 6-4 victory over elder sister Venus in Melbourne.
"It feels good, it has been a long time," Williams said. "I played an incredible opponent in Jessica and honestly it was a great match."
Williams had struggled for consistency earlier in the week, but sent an ominous message to the Australian Open field when she demolished promising teenager Amanda Anisimova 6-1 6-1 in their semi-final and then beat an impressive Pegula on Sunday.
"I was definitely improving as the week went on and I needed to because I had some tough matches," Williams said.
"I feel fortunate and blessed to be out here and to be healthy and to play. I have been playing for so long and been through so much and I'm happy to be doing something I love."
French Open 2021 - How to watch Roland Garros and more key info
Federer in, Serena out - What does Madrid entry list mean for legends' seasons?