The incident took place at the metropolitan magistrate's court in Dadar, central Mumbai, police said.
Mahesh Mahaparolkar and Nandesh Kadwarkar were accused in an assault case registered at the Dadar police station in 2009. Both were acquitted by the magistrate today, Assistant Commissioner of Police Dinesh Bhalchandra Joshi said.
Apparently angered by the acquittal, the complainant in the case, Harishchandra Shirkar, took out a knife from his pocket and attacked them, he said.
Mahaparolkar and Kadwarkar suffered injuries to head and hand. They were admitted to a hospital for treatment, and their condition was stated to be stable.
Shirkar was arrested under section 324 of the IPC (voluntarily causing hurt by dangerous weapons).