Abdi Kafar, Mustafa Abdi, Abdallah Jama and Harun Ali denied the charges before chief magistrate Heston Nyaga and were remanded to Pangani police station.
A report by the prosecution stated the doctor was attacked on July 14 while driving on Muratina road after closing her clinic in the area.
The prosecutor said the gang took control of her car and forced her into the back seat without saying a word.
The four are said to have forced a metal rod into the victim's private parts, seriously injuring her and causing massive bleeding.
The court also heard that they forced her to perform oral sex. The doctor obliged as her attackers had threatened to kill her.
"They warned her never to go to Eastleigh area or she would be killed," the prosecution said adding the thugs drove away with the doctor's car but did not steal anything.
The men were also charged with violently robbing the woman of her vehicle valued at Sh980,000.
They were further charged with being members of an organised criminal gang named Superpower.
Police said the woman screamed for help in vain and was left at Shauri Moyo area unconscious.
Her attackers were arrested later after being identified. They were remanded after the prosecution sought to take exhibits to the government hospital for analysis.
The case will be mentioned on August 5.
YouTube Channel: Health Then More