Wawrinka, the 17th seed, was sloppy in the opening two sets, committing 29 unforced errors and landing just over 60% of his first serves.
The Swiss, however, rediscovered his touch in the third set as he broke Fucsovics in the opening game before taking control with a string of blistering backhands.
Fucsovics recovered in the final set and appeared to have secured a hard-fought win when he took a 5-3 lead but Wawrinka found another gear to draw level at 5-5 before forcing a final set tiebreaker.
Wawrinka, the 2014 winner at Melbourne Park, raced to 6-1 lead and gave himself three match points but Fucsovics clawed back with some fearless hitting to draw level at 9-9 and went on to seal victory in just under four hours on the John Cain Arena court.
“Right now, I feel like I’m dying,” said world number 55 Fucsovics, who also needed five sets to beat Marc Polmans in the opening round.
“I’ve played two five setters and it’s really hot. I knew he would come back, he’s very strong mentally and physically. But I was very strong mentally and that was the most important thing.”