The Swiss defending champion dropped his only sets of the tournament before completing a 6-2, 6-7 (5/7), 6-3, 3-6, 6-1 win over the sixth seeded Croatian in 3hr 3min.
Federer, playing in his 30th Grand Slam final, joined Novak Djokovic and Australian great Roy Emerson as joint top for the most Australian Open men's titles.
"I'm so happy it's unbelievable. This is a dream come true, the fairytale continues for me," Federer said at the presentation.
"After the great year last year, it's incredible," the 36-year-old added as he broke down in tears.
Federer added to his already imposing win-loss record in Melbourne and is now 94-13. His overall his Grand Slam mark stands at 332-52.
"It was an amazing journey to come to the final. It could have been the best two weeks of my life, but Roger played a great fifth set," Cilic said. "I want to thank my team, you're unbelievable. We worked hard for this year, hopefully we will lift these trophies in the future."
The roof was closed over Rod Laver Arena as the tournament's heat policy was implemented amid evening temperatures of 38C.
Cilic's serve came under immediate pressure with a whipping backhand return winner for break point which the Croatian followed with a smash into the net for a break in the opening game. The Croat was finding it difficult to settle and changed racquets in his second service game, but it had no obvious benefit as he dropped serve again after three break points to trail 0-3.
He finally held serve to get on the board but the Swiss star was too good, serving out the set in just 24 minutes after a shaky Cilic opening.
Federer fought off two break points in his opening service in the second set with pinpoint serves, while Cilic had a tussle before holding in the third game.
Cilic worked his way back into the match as both players traded furious forehands to stay on serve. Cilic was break point down in the ninth, but crucially got out of it with a second serve ace down the middle followed by a forehand winner.
The Croat had a big moment in the 10th game when two Federer double faults gave him set point, but a tentative backhand into the net and a wild backhand cost him his chance.
In the tiebreaker, Cilic got to two set points when his forehand clipped the line before a winning smash levelled the match as Federer dropped his first set of the tournament. But Cilic lost serve on the back of a couple of ground stroke errors and Federer raced 4-2 up in the third set.
The defending champion shifted gears with a stunning forehand off his toes and confidently held serve to lead 5-2 before clinically serving out the set in 29 minutes.
Cilic was then broken in the opening game of the fourth set with a poor backhand dropshot into the net as Federer closed in for the kill. But the Croat broke back in the sixth game with three break points when Federer netted and fought off a break point in the next game to put his nose in front.
Cilic was now more in the flow and broke Federer again with his big forehands starting to find their mark. He served it out to take the absorbing final into a fifth. But Federer stayed calm and produced quality backhands to hold on to his serve amid mounting tension.
The world No.2 crucially broke to 2-0 and got a vital double break when Cilic netted a forehand, leaving him to serve out for the championship.