The confrontation occurred in the Bronx borough in the city between the marshals and suspect Andre Sterling. Authorities said one marshal was shot in the elbow and thigh and the other in the leg.
Their injuries were described as non-life threatening. Officials said Sterling was killed in the shootout.
Authorities wanted Sterling, 35, a Jamaica native, in connection with the shooting of a Massachusetts state trooper last month. The trooper survived after a bullet went through his hand and struck his bulletproof vest.
Sterling also had warrants for assaulting a police officer and identity fraud, authorities said, and he was wanted on a drug charge in Wyoming.
Law enforcement had said Sterling was armed and dangerous.