Sock is the first American to reach the semi-finals of the season-ending event since Andy Roddick in 2007.
The 25-year-old, up to a career high ninth in the world rankings, only qualified for the Tour Finals thanks to his first Masters title in Paris earlier this month.
Sock was so sure he wouldn't make it to the O2 Arena that he had planned to play a round of golf at Augusta this week.
"That was a rollercoaster match. I didn't have the hottest start in the third but I kept in there and kept fighting," Sock said.
More From This Section
Dimitrov, who takes on Pablo Carreno Busta on Friday, qualified for the last four after winning his first two matches.
Federer's opponent will be either Belgian David Goffin or Austria's Dominic Thiem, who clash in a winner-takes-all Sampras group tie on Friday.
Cilic had been hampered by a blistered foot and the Croat was reduced to tears during the match as his predicament sunk in.
In their first meeting since that All England Club showdown, Federer frustrated the already eliminated Cilic once again as he fought back to win 6-7 (5/7), 6-4, 6-1.
By extending his current winning streak to 13 matches, the 36-year-old advanced from the Tour Finals group stage with an unblemished 3-0 record for the 10th time in his glittering career.
"It was a tough match. I was in trouble, a set and a break point down, but I found a way out of it and I'm happy to be playing this way," Federer said.
"It's nice to play tennis this freely. It gives me a great idea how I want to be on Saturday. I'm looking forward to facing (David) Goffin or (Dominic) Thiem."
==========
The prize money from Federer's win over Zverev on Tuesday took him past golfer Tiger Woods to become the world's highest earning athlete, with a career total of 84 million ($110 million, 94 million euros) according to Forbes.
But Federer is motivated by his legacy rather than the size of his bank balance.
Winning the Tour Finals for the first time since 2011 would be another feather in his cap at the end of a remarkable renaissance year, which has seen him capture seven titles.
Zverev is tipped as a possible heir to Federer's throne, but the 20-year-old still has work to do after an erratic display against Sock.
When Zverev maintained his assault with a break in the first game of the deciding set, Sock smashed the ball into the crowd with such force that he was punished with a penalty point.
Sock channelled that rage with a burst of power hitting as he won four successive games.
In a dramatic finish, Zverev roared back from 4-1 down to draw level, only for Sock to pounce on his first match point.