The 35-year-old, who had battled for nearly five hours to upset Matteo Berrettini on Tuesday in his best result since 2017, forced a deciding set after going two down and finally prevailed 4-6 6-7 (4) 7-6 (5) 6-3 7-5 at gone 4am in Melbourne.
At five hours and 45 minutes, it was the longest match of Murray's whole career and the third latest finish to a tennis match ever.
Asked how he had managed to come through it, Murray told Eurosport: "I don't know. It was unbelievable that I managed turn that around.
“Thanasi was serving unbelievably, hitting his forehand huge and I don't know how I managed to get through it.
"I did start playing better as the match went on - and yes, I have a big heart."
Home favourite Kokkinakis dominated the opening two sets with the kind of aggressive tennis and ball-striking that made a mockery of his world ranking of 159.
Murray's resistance looked over when Kokkinakis led 5-2 in the third set with the Australian on the verge of his biggest career win. But Murray would not go away.
Kokkinakis got tight with the finishing line in sight and the venom gradually went out of his shots as Murray threw caution to the wind and locked on to his target.
Relentlessly Murray ground his way back into the contest to set up a deciding fifth set, sealing the fourth set with a second-serve ace.
A weary-looking Kokkinakis did not capitulate and the raucous atmosphere inside the stadium revived him early in set five as he kept his nose in front on serve.
There was pandemonium when he saved four break points at 3-3 and Kokkinakis was within two points of victory when Murray served at 4-5 in the decider.
But Murray's greater experience of such duels enabled him to get the crucial break of serve in the following game with a stunning forehand winner before sealing victory in the next game on his first match point with a backhand winner.