Victory for the Dane, who lost in the final of the 2010 WTA finals and twice in the US Open final, ended years of near misses on the biggest stage and capped a memorable 2017, where she reached eight finals and added a second title to the Pan Pacific crown which she won in September.
"I am so happy I managed to win in the end," said the champion who capped a memorable return from an injury-plagued 2016 to claim the Billie Jean King Trophy.
"Eight is my lucky number. If I was going to beat her (Williams) once in my career, it had to be today.
"I couldn't be happier right now. It's been an amazing year. Last year was tough with injuries but I fought my way back and to stand here and win the title means a lot to me."
Sky Bet offer Wozniacki at 16/1 to win her first Grand Slam title at the Australian Open in 2018.
Wozniacki had beaten Elina Svitolina and Simona Halep in the group stage before a brilliant victory over Karolina Pliskova in the semi-finals.
But heading into the game, Wozniacki had failed to win any of her seven career meetings with Williams and had only taken one set from those contests but she started fast to set the tone for her victory.
Three breaks from the Dane gave Wozniacki the edge, the pivotal moment coming when she broke the Williams serve leading 5-4 to seal the opening set before racing into a 5-0 lead in the second.
One game away from the title, Wozniacki was broken twice in succession by Williams as she reeled off four successive games to threaten an unlikely comeback. However, once again 5-4 proved to be crucial for Wozniacki as behind her own serve she fired a brilliant backhand winner to seal the title and a rise to number three in the final world rankings.
Williams will remain fifth in the rankings after a year of coming close and having defied her years in 2017 has high hopes of going again next year.
"I didn't seem to come up with my best tennis until it was too late," said Williams. "I love being here, it is an honour. Only eight players get to be here and I hope to return."
Related links