Gaza health ministry spokesman Ashraf Al-Qudra said they were hit by an Israeli strike on the Egyptian side of the border in Sinai.
The circumstances of the deaths of the two men were unclear however.
The incident comes after several rockets were fired Wednesday evening from Sinai at the Israeli Red Sea resort of Eilat.
The Israeli military had not confirmed by early Thursday that it had carried out retaliatory strikes.
Sinai borders Israel and also the Gaza Strip for a few kilometres at the northern end of the peninsula.
The Palestinian deaths occurred much further north than the scene of the rocket fire on Wednesday, which the Israeli army said did not cause any injuries.
Egyptian forces have been battling an Islamist insurgency in northern Sinai which escalated after the military overthrew Islamist president Mohamed Morsi in 2013.
Israel has also denounced the movement of men and weapons between Sinai and the Gaza Strip, which is governed by one of the Jewish state's major enemies, Hamas.