Prosecutor Nel went after Derman aggressively in his cross-examination, exploring whether the shooting was an instinctive "fight-or-flight" response or the result of conscious thought.
The question of whether Pistorius is found guilty of premeditated murder could hinge on the answer.
Exchanges between the two got testy, with Nel trying to get the doctor to explain Pistorius' actions moment by moment on the night he killed Steenkamp.
Derman said it was impossible for him to answer theoretical questions about what Pistorius might have been thinking or doing at a given instant because he, Derman, knew what had actually happened after the moment in question.
Frustrated, he appealed to Judge Masipa, but she sided with Nel, firmly instructing the witness to answer his questions or say he didn't know.
Nel began his cross-examination by suggesting that Derman was not a trustworthy witness because he had a responsibility to Pistorius as his doctor. Masipa rejected the objection.
The prosecutor kept up the attack, demanding to know when Derman had made particular notes on Pistorius, whether the court should believe Derman or Pistorius when their evidence differed, and the meaning of the word "subsequent."
Derman grew irritated with Nel when the prosecutor responded: "That's not true" to a statement Derman gave, and he appealed to the judge that Nel was being "unprofessional."
Masipa agreed and ordered Nel to withdraw the remark.
Nel, in turn, showed annoyance with Derman asking which "incident" he was referring to.
"The killing!" Nel shouted back at him.
The defense has been exploring Pistorius' mental health for several days.
On Wednesday, his lead lawyer Barry Roux said Pistorius is depressed, suffering from post-traumatic stress disorder, and is a suicide risk, according to the doctors who spent a month evaluating his mental health.
But he does not appear to have a history of abnormal aggression or psychopathic tendencies linked to "rage-type murders in intimate relations," they found.
The conclusions are a "slam-dunk for the defense," CNN legal expert Kelly Phelps said.
The psychiatric report seemed to suggest that Pistorius' version of events was plausible.
"When Mr. Pistorius's appraisal of the situation is that he might be physically threatened, a fear response follows that might seem extraordinary when viewed from the perspective of a normal bodied person, but normal in the context of a disabled person with his history," the doctors found.
Several witnesses have testified that Pistorius tends to arm himself and go toward danger, rather than away from it, when he thinks he is under threat.
At the trial's conclusion, Judge Masipa will have to decide whether Pistorius, 27, genuinely made a mistake or deliberately murdered his girlfriend.