Murray had never beaten the Swiss at a major, but was a deserved 6-4, 6-7, 6-3, 6-7, 6-2 winner as he moved into Sunday's title-decider against the world No 1 Novak Djokovic.
The Scot missed the chance to serve out the match in the fourth set at 6-5, but responded superbly in the decider to set up a rematch with Djokovic, who he beat to win the US Open in September.
"It's always tough against Roger," Murray said. "I think the slams are where he plays his best tennis.
"When his back was against the wall at 6-5 he played some unbelievable tennis. He missed some shots at the start of the fifth and I just stuck in there."
As for the meeting with Djokovic, who thrashed David Ferrer in his semi-final on Thursday, he added: "I didn't see much of his game although I heard about it. I heard he played very well.
"I will have to play my best tennis to win it."
Djokovic and Murray met in the final two years ago, with the Serbian winning comfortably on that occasion in straight sets.
The pair met at the semi-final stages in Melbourne 12 months ago, with Djokovic winning in five sets before going on to beat Rafael Nadal in the final.
Murray arguably could have won more comfortably against Federer as he played the better tennis for the first two sets, but allowed his opponent to win the tie-break in the second set.
Having gone ahead again by taking the third, Murray then failed to serve out the match in the fourth set, before losing the tie-break.
But Murray broke twice in the final set to set up his third successive encounter with Djokovic in Melbourne Park.
Follow us @SprtNationalUAE