The incident happened near the canteen area, triggering chaos in the court premises.
The accused posed as a litigant, the police said.
More details were awaited.
This was the second shootout near the court complex. In April, a 38-year-old undertrial was shot dead there.
Disclaimer: No Business Standard Journalist was involved in creation of this content