McPhee held the match-winning midfielder to 17 possessions at Subiaco Oval - his lowest return of the season - and Hayes managed just one touch in the final quarter as Fremantle mounted an unsuccessful late challenge.
McPhee has battled to find form this year, averaging 13 possessions a game after a shoulder injury and a recurring ankle problem interrupted his pre-season.
However, he said his fitness was now at a level that would allow him to play more midfield roles as he looks to find a place in his new side.
“It’s not something I’ve played a lot of, but I really enjoyed it,” he said of his role on Hayes after the match.
“It was great to play on a quality player, and it's something I’ll take a lot out of.
“It’s an area I would love to get in a lot more, (but) we’ve got a lot of players playing really well at the moment.
“I think my fitness is there to play a tagging type role, (so) for me to get some confidence and then learn from some of the best players in clearances was great.”
McPhee, who said testing himself in the midfield was one of the reasons he left Essendon for a fresh start at Fremantle this year, set himself to make life difficult for Hayes at the stoppages, and he restricted the All-Australian to just four clearances.
He said he would take a lot out of the experience and implement it into his own game, but he was unsure if the midfield roles would continue.
“My football hasn’t been at a consistent level (and) I’m still obviously trying to find my way and get confidence, so at this stage I’m happy to play a role that allows us to keep winning games of footy,” he said.
Fremantle travels to Melbourne to face Carlton on Saturday night with its top-four spot on the line, and after back-to-back losses, McPhee said it was important for the side to regain some momentum ahead of the mid-season break.
“You wouldn’t want to lose three. We’ve got a big focus on the road and Carlton’s going to be a good challenge," he said.
“They’ve beaten some of the best teams in the comp, and they’ve had some average performances where they probably thought they should have won.
“It’s going to be a big test for us this week.”
Game analyser: watch your team's highlights