The pair stubbornly held serve until Djokovic pounced in a dramatic eighth game.
At 15-30, in one of the points of the tournament, Federer scrambled back to retrieve a lob then to the corner to lace a backhand winner down the line that prompted a standing ovation from the crowd.
But the elation ended seconds later when Federer made a desperate rush forward and Djokovic's shot deflected off the net and past the Swiss's racquet to hand the Serb break point.
The Swiss threw caution to the wind by attempting a second-serve serve-and-volley but Djokovic blasted a marvellous cross-court return to capture the decisive break.
Closing out the match when Federer netted a backhand, Djokovic was left celebrating another memorable victory as he stood one win away from a record sixth title at Melbourne Park.
"My rhythm, my timing, all that, was a bit off in the beginning," Federer told reporters.
"He took advantage of that and did an unbelievable job for a long, long time tonight."