Goffin mustered only two games on Wednesday against an inspired Grigor Dimitrov, who will finish top of the pool, and looked set for another thrashing when Thiem stormed ahead 3-0.
But this time Goffin fought back, claiming 12 out of the next 14 games at London's O2 Arena to win 6-4 6-1 in just an hour and 11 minutes.
Goffin's golden streak included taking an astonishing 15 points in a row during the opening set and he will now face the tournament's overwhelming favourite Federer, for a place in Sunday's final.
Dimitrov plays Spain's Pablo Carreno Busta in the last of the group matches later on Friday but the Bulgarian has already guaranteed his place in the semis, where he faces American underdog Jack Sock.
Goffin has lost all six of his previous encounters against Federer but the world number eight will take heart from this clinical display that makes him the first Belgian ever to make the last four of the competition.
Defeat, meanwhile, for Thiem extends the talented 24-year-old's troubles on any surface but clay. He has seven wins from 16 matches against top-10 opponents on the red sand but now only two from 18 on hard.
The Austrian made a dream start, winning the first three games in just eight minutes, including a break of serve when Goffin hit long with a forehand.
From there, however, Thiem unravelled as Goffin won three games in a row to love and another to 15, before serving out the set.
Thiem took a break to have a cut on his knee treated but when play resumed there was no change of momentum as Goffin broke once with a dipping forehand into the corner and then again when his opponent framed a backhand wide.
Four break points offered Thiem the chance of a comeback at 4-1 but Goffin thwarted the challenge before another of his sweeping backhands confirmed victory.