Wozniacki served for the match in the third set and led 4-1 in the deciding tie-break but Williams battled back.
The world number one will face Simona Halep in the final after the Romanian beat Agnieszka Radwanska 6-2 6-2.
That racquet will never do me wrong again, I tell you
"Caroline played a great match, it was really difficult today. I feel so bad," said the 33-year-old American.
"She's the only one undefeated (after the group stages) in this tournament and she deserved to win."
Wozniacki admitted: "This really sucks. You know, being so close and still losing, it really sucks."
Williams had earlier smashed her racquet in frustration as the first set slipped away, but two breaks of serve brought the reigning champion level in the second set.
The third set was an epic affair, lasting longer than the first two combined, but after grabbing a break at 4-4, Wozniacki was unable to serve out the contest.
She saved a match point in her final service game and the Dane again looked on course for only her second win in 11 meetings with her good friend when she moved 4-1 clear in the tie-break.
Williams would not be denied, however, reeling off five straight points and finally sealing victory on her fourth match point after two hours and 13 minutes.
"I don't know how many times I hit it, but boy, that racquet will never do me wrong again, I tell you," Williams said of her angry outburst in the first set.
"It was definitely legendary. I kind of lost my cool a little bit. I thought, well, at least you know I'm passionate. I give 200%.
"When I play, doesn't matter how I feel, I'm going to give everything I have for every shot and every point."
Williams will face a rematch against Halep on Sunday, four days after  against the Romanian in the group stage.
"I'm excited. My goal is to win three games. That'll be my first goal. I'm going to go from there," joked Williams.
"Hopefully I can hold serve. That would be good. Most of all, I hope to break once."
Halep broke Radwanska's serve five times and hit 26 clean winners as she swept past the Pole to reach the final on her first appearance at the WTA season finale.
Serena Williams beat Caroline Wozniacki in a thrilling contest to reach her third consecutive final at the WTA Tour Finals in Singapore.