The deceased, identified as Sandeep of Mokhra village, was shot at by four unidentified men, dressed as lawyers, police said.
Sandeep was later rushed to a local hospital where he was declared as brought dead, they said.
The assailants managed to escape after the crime, police said, adding, an old enmity was said to be the cause behind the crime.
Sandeep had come to the court in connection with the hearing of a case registered against him.
A case has been registered against suspects Jaibhagwan and Sanjiv of Shamlo Kalan village and Vikas and Ashish of Kathura village in the matter, they said.