Dewani, who made a third brief appearance in Cape Town's high court after his extradition from Britain, has been ordered to undergo the same type of mental assessment as South African Paralympian Oscar Pistorius, who is also on a murder charge.
Prosecutors applied for the 30-day test by a panel of experts after receiving two conflicting psychiatric reports on Dewani's mental readiness for trial, the court was told.
Defence lawyer Francois van Zyl did not oppose the application before Western Cape High Court judge president John Hlophe, and said he believed Dewani would be able to stand trial.
"The accused will be ready, fit to plead for the trial to proceed on 6th October, but of course it is subject to what the panel finds," he said.
Dewani, who denies ordering the killing of his 28-year-old bride Anni in Cape Town in November 2010, looked anxious and murmured to himself at one stage, apparently struggling to hear as the judge made the order.
The businessman claims he and Anni were hijacked at gunpoint during their honeymoon as they drove through the Gugulethu township in a taxi.
Dewani escaped unharmed, but his wife's body was found in the abandoned car the next day. She had been shot dead.
Prosecutors allege Dewani hired a South African, Xolile Mngeni, to kill his spouse. Mngeni was jailed for life for the murder in December 2012.
Two other men also jailed over the killing allege that Dewani ordered the hit.
Dewani, who returned to Britain shortly after Anni's murder, fought extradition for three years, claiming he had mental health problems including depression and post-traumatic stress.
If he is not found fit to face trial within 18 months, he will be returned to Britain under the terms of his extradition.
Dewani was remanded in custody for the assessment at Valkenberg hospital in Cape Town, where he has been receiving treatment since his extradition.
He will appear in court again on , when it is expected that a decision will be made on whether to go ahead with the trial or not.
The prosecution is expected to argue that Dewani is gay and plotted to have his wife killed to escape an arranged marriage that he was pushed into by his family.
The case sparked outrage among South Africans who accuse Dewani of callously using the country's reputation for violent crime to murder his wife in the belief that he would get away with it.