The incident occurred at about 3:42 a.m. in the 1600-block of South Drake Avenue.
Police said officers were attempting to arrest a suspect for possession of a stolen car when the suspect attempted to steal an officer's gun.
One of the officer's guns went off during the encounter, police said. No one was struck by the gunfire.
The officer with minor injuries was transported to a hospital in fair condition. The suspect was taken into custody and transported to Mt. Sinai Hospital for minor injuries, police said.
The Civilian Office of Police Accountability is investigating.
INTERACTIVE SAFETY TRACKER Track crime and safety in your neighborhood