The army confirmed that troops fired on a group of gunmen near the Karni border crossing on Wednesday, saying they were suspected of trying to plant a bomb at a buffer zone where there are Israeli patrols.
One of the two gunmen was killed at the scene while a second died of his wounds at Gaza City's main hospital, medics said.
Al-Aqsa Martyrs Brigades, an armed wing of the Palestinian Fatah faction, claimed the slain gunmen as its own.
Al-Aqsa is one of several groups spearheading a more than five-year-old Palestinian uprising.
Gaza, which Israel quit last September after 38 years of occupation, has suffered a flare-up of violence in recent days.
Israel has killed 11 gunmen in the territory since the weekend, most in air strikes. The army said most of those targeted were involved in cross-border rocket salvoes.