Williams, in her fourth decade on the WTA Tour, lost the Wimbledon and US Open finals in 2018 and 2019 and retired from the 2019 Rogers Cup final.
She said after her victory that she would donate her prize money in Auckland and a dress she had worn to the Australian bushfire appeal.
"It feels good. It's been a long time, I think you could see the relief on my face," said Williams.
"I have been playing for so long and been through so much and I'm happy to be doing something I love."
The Australian Open begins on 20 January, with Williams bidding to equal Margaret Court's record of 24 Grand Slam singles titles.
Congratulation, Compton Queen !!!!!!!