Federer, sidelined some six months after knee surgery last year, returned to win his 18th Grand Slam title at the Australian Open in January.
With Sunday's triumph in the all-Swiss final, Federer joined Novak Djokovic as the only men to win five Indian Wells titles, adding to those he won in 2004, 2005, 2006 and 2012.
At 35, Federer is the oldest ATP player to win one of the elite Masters titles, supplanting Andre Agassi who was 34 when he won in Cincinnati in 2004.
"It's been just a fairytale week once again," said Federer, who missed Indian Wells last year because of injury.
"I'm not as surprised as I was in Australia, but still this comes as a big, big surprise to me, nevertheless, to win here again and beating the players that I did and the way I did.
"I couldn't be more happy. It's an absolute, huge start to the year for me. Last year I didn't win any titles. I don't think I was in any finals except maybe Brisbane last year. The change is dramatic, and it feels great."
The speedy progress means 10th-ranked Federer will have to reassess his 2017 goals. Prior to the Australian Open his aim was to get his ranking to as high as eighth by the time Wimbledon was over.
"The goals are clearly changing after this dream start," Federer said.
While Federer had won 19 of 22 prior meetings with Wawrinka -- including a semifinal win in Melbourne -- he noted that his compatriot would be no easy mark as he played his first tournament in America since winning the US Open in September.
But Federer claimed a tightly contested first set with a break in the 10th game, pushing Wawrinka into a forehand error to end a tense rally for a set point, on which Wawrinka sent another forehand long.
Wawrinka responded immediately with a break to open the first set -- after Federer had held all 42 of his service games in the tournament to that point.
He had saved the lone break point he faced -- in his straight-sets thumping of Rafael Nadal in the fourth round -- but sent a backhand long on break point to give Wawrinka the advantage in the set.
Wawrinka then withstood two break points to hold for a 2-0 lead, which proved short-lived as Federer won the next three games to take a 3-2 lead.
Wawrinka a Federer fan
Finally Wawrinka found himself serving to save the match. A backhand into the net gave Federer a chance, and he seized it with a volley winner.
"I've lost some tough ones against you, but when you played the final in Australia, I was your biggest fan," a choked up Wawrinka told Federer at the trophy ceremony. "So congratulations on your comeback and congratulations on today."
Although he owns three Grand Slam titles, Wawrinka was playing in just his fourth Masters final and has won just one of the prestige events -- beating Federer in the final at Monte Carlo in 2014.
"It's a tough loss," he said. "In a way, I'm really happy to make the final. It's a great result on that, but you always want more."
After fearing that knee trouble in the wake of the Australian Open would slow his season, Wawrinka was pleased to play at a high level.
"After Australia, I wasn't in a good position," he said. "I was really, really struggling with my knee. I wasn't sure to be back here in that level that quick.
"But I still lost the final," he said. "So it wasn't easy."