The Swiss eighth seed beat Djokovic 2-6, 6-4, 6-2, 3-6, 9-7 in a four-hour quarterfinal on Rod Laver Arena to set up a semifinal with Czech seventh seed Tomas Berdych.
It ended a 14-match losing run against Djokovic for Wawrinka, who had gone down in two previous five-setters in majors to the Serb, at last year's Australian Open and US Open.
The stunning defeat halted Djokovic's 28-match unbeaten run since the US Open final and his 25-match winning streak at the Australian Open stretching back to 2011.
Djokovic also became the first defending champion to lose before the semi-finals at the Australian Open since Rafael Nadal retired injured against Andy Murray in the quarter-finals in 2009.
"Last year (at the Australian Open) I didn?t finish it and it was really tough," Wawrinka said.
But this year I came back, it?s a new year and I was feeling really good," he said.
"I tried everything, he's an amazing champion? I'm really, really, really, really happy."
It is Wawrinka's second Grand Slam semi-final after losing to Djokovic at last year's US Open.
Djokovic jumped away with a service break in the sixth game and broke Wawrinka again to take the opening set with an angled crosscourt winner off a net cord.
But the Swiss cranked it up in the second, breaking Djokovic with a tremendous backhand winner on his way to levelling the match.
It was in the third set where a rampant Wawrinka took charge with a double service break to have rattled Djokovic screaming at his coach's box in frustration.
READ THE LOCAL'S INTERVIEW WITH STANISLAS WAWRINKA HERE
Djokovic finally got his first break point in two-and-a-half sets in the eighth game of the fourth set and broke when Wawrinka's forehand went wide, prompting the Serb to give a prolonged howl of delight.
The Serb had to survive two break points as he served for the set and he rose to the challenge with a couple of aces to take the match into a fifth set for the third time between the two players at Grand Slams.
Djokovic stepped it up and after the Swiss missed an easy volley at the net to bring up break point, the Serb worked Wawrinka wide to get the break in the third game of the final set.
But Wawrinka quickly broke back as the gripping match took another twist.
Games went with service — with Djokovic, serving from behind, always under pressure — until the 16th game when two back-to-back errors from the Serb handed Wawrinka a stunning victory.
"I was feeling great on the court and was focused on that. I was trying to stay aggressive," the Lausanne native said.
"I always fight, I always try and tonight I won so I'm really happy."