Angel Alvarez was arrested Sunday afternoon as he was being discharged from the hospital.
Alvarez was shot nearly two dozen times during the shootout last week.
Police say Alvarez fought with 22-year-old Luis Soto, wrestled a gun away from him, then fired at police.
More than 50 shots were fired - 46 of them reportedly by New York City police officers.
Soto was hit five times, with the fatal shot being fired by police.
Alvarez is charged with attempted murder, attempted assault and criminal possession and use of a firearm.