The Swiss number two lost 1-6 7-5 6-4 6-7 12-10 to the world number one in 302 action-packed minutes at the Rod Laver Arena.
Wawrinka, who had served for a two-set lead at one point, admitted that the result has left him "sad", but said that there are positives to take from his performance.
"I think it's by far the best match I ever played, especially in five sets against the number one player," Wawrinka told reporters. "At the end I was really, really close, so for sure I'm really sad. But I think there is more positive than negative.
"At the end he was still there. He was playing great tennis. We were both tired, but I really fought like a dog."
He added: "I think I can use [my performance to spur me on], I hope I will use it. I think it's important if I want to keep improving myself, my game, to try to come back closer to the top 10."
Djokovic now faces a quarter-final clash with fifth seed Tomas Berdych.