The firefighters were called to a home in the town of Webster. The shooter, who also died, apparently took aim at the firefighters as they arrived at an early morning house and vehicle fire in the Rochester-area town of Webster, Police Chief Gerald Pickering said.
"It does appear that it was a trap that was set for first responders, but causative reasons we don't have at this time," he said.
"Four of the firefighters were shot. Two are deceased, two were transported to area hospitals.
"These people get up in the middle of the night to put out fires, they don't expect to be shot and killed."
Pickering said the two injured firemen were in a serious condition.
The gunman is also dead and police say they believe he committed suicide.
A security cordon was put up around the scene and residents were evacuated.
New York governor Andrew Cuomo called the incident a "horrific shooting" and offered his condolences to the families of the victims.
Linking us to 26/11 is a crude smear attempt: ISI
'He spoke to us as if he knew us for a long time'
'Tata India's best-known global brand'
Speculation starts in US on who will run in 2016
IN PHOTOS: America VOTES for its next president