Federer, 36, recovered from back and knee problems in 2016 to win the Australian Open and Wimbledon titles last year, and that saw him beat fellow nominees Nadal, Cristiano Ronaldo and British trio Chris Froome, Mo Farah and Lewis Hamilton to claim the sportsman of the year prize.
Upon receiving the award, an emotional Federer said: "To my rival Rafa, I wanted to just give a shoutout to him.
"He had an unbelievable year himself. We had a great battle and it's because of a guy like him, I feel like I've become a better player as well.
"He could very well be here as well and standing here with this award. He's an incredible player, incredible friend, an incredible athlete."
Federer expanded on his relationship with Nadal at a news conference after the event, adding: "All the matches that you've played against one another, they sort of connect you to some extent.
"When you lose against a guy 9-7 in the fifth [set] or you win 9-7 in the fifth, it leaves something special there for everyone.
"Whenever you walk past a guy, you know there was a match that really shaped your character maybe as well."
The 20-time Grand Slam champion also revealed that the constant questions he has faced about possible retirement for nearly a decade have driven him on.
"It's like a hammer banging at the door, eventually you feel like it's going to break through," he added.
"You have to hold back the door and just not let that come to you. I think it's made me extremely resilient and strong, having to answer all these questions.
"I think this has been a big challenge for me, just not letting that get to my head and truly listening to myself and my team. Can I actually still win? As long as I believe truly I can still win, then I believe it was worth it to come back. That's the feeling I had. I feel like I never really let that [negativity] come to me.
"It's been wonderful -- not to prove people wrong, but just to prove myself and my team right."