Prop Nyakane was sent on for Frans Malherbe in the second half of the 41-7 victory in Kumagaya but was forced off just 14 minutes later.
However, the 30-year-old did not sustain a serious injury and is expected to be available when the Springboks begin their World Cup campaign against reigning champions New Zealand on September 21.
"The tighthead prop sprained a knee during the 41-7 victory over Japan in Kumagaya on Friday and was limited to a 14-minute appearance," read a statement from the Springboks.
"Nyakane made a scheduled return to South Africa on Saturday to be with his wife for the birth of their child this week. He will arrive back in Japan on Friday."
Following their match with the All Blacks, Rugby Championship winners South Africa take on Namibia, Italy and Canada in their other Pool B fixtures.
Photo Getty Images Caption: South Africa prop Trevor Nyakane