The victory was in the U.S. Open first round on Tuesday.
The 33-year-old Briton, contesting a singles match at a major for the first time since the 2019 Australian Open, appeared to be heading for an early exit.
The fearless Nishioka outplayed him for two sets on a virtually empty Arthur Ashe Stadium.
Yet as he has so often done throughout his career, Murray simply refused to accept defeat.
Desperately trying to spark himself into life, Murray recovered from a break down in the third set and saved a match-point late in the fourth.
At the start of the fifth set he required treatment on his battered toes.
He again slipped a break behind before dredging his tank to finally crush 49th-ranked Nishioka’s spirit and claim victory in four hours 38 minutes.
It was Murray’s 10th win from two sets down and showed that, in spite of undergoing two hip surgeries, he remains one of the sport’s great warriors.
“I’m tired. My toes are the worst part. My big toes are pretty beat up,” Murray, whose emotional defeat in five sets against Roberto Bautista Agut in Melbourne in 2019 looked like ending his career, said on court.
“At the beginning I was apprehensive about playing a long match, because I’ve not played one for a while and I was sort of pacing myself.
“But when I was two sets down I managed to put the after-burners on and managed to get through.”
Murray will have to recover quickly as his next opponent could be Canadian 15th seed Felix Auger-Aliassime.
He said his first job was to try and find an ice bath.
“They have one in the locker room but that’s supposed to be for an emergency. This is an emergency,” Murray said.
Murray, who claimed the first of his three Grand Slam titles in New York in 2012, opened the match with a delicious topspin lob.
But for the next two sets he was second best against the 24-year-old showing absolutely no respect for reputations.
Nishioka broke decisively at 3-3 in the opener and sprinted 4-0 ahead in the second as Murray briefly looked ready to fold.
Murray was a point away from falling 5-0 behind, but he clawed his way back, only to break a string.
He ballooned a forehand long on set-point when returning at 4-5 down.
Nishioka led 3-1 in the third set but, with his back to the wall, Murray ratcheted up the power on his forehand and broke back.
Murray saved more break points at 5-5 but eventually wrestled the set from Nishioka in the tie-break.
Murray made a hash of a volley at 5-6 in the fourth and Nishioka reached match-point, only to pump a forehand return out.
The Briton again prevailed in the tie-break to set up a fifth.
Nishioka looked crestfallen but quickly regrouped to engineer a break at 2-2 with a dipping forehand.
Murray responded immediately, breaking back with an exquisite topspin lob.
Yelling to himself and at his coach Jamie Delgado, and grimacing in pain from his toe, Murray soaked up everything the gallant Nishioka threw at him.
He then pounced in the 10th game to claim a remarkable victory, again a topspin lob doing the trick.(Reuters/NAN)