Israeli media say the troops were killed when they were mistakenly hit by Israeli tank fire on Wednesday.
It happened in Jabalia in northern Gaza, where Israeli forces are battling Hamas fighters.
Troops went back into the town this week after previously pulling out, saying Hamas had regrouped there.
Tens of thousands of civilians have fled Jabalia since Saturday, when the Israel Defense Forces (IDF) launched an operation with air strikes. Troops re-entered Jabalia on Monday.
Fighting there and in the southern town of Rafah, where about half of Gaza’s civilian 2.3 million population had taken shelter, has intensified in recent days.
Some 600,000 Palestinians have since fled Rafah, and another 100,000 have been newly displaced by a resurgence of fighting in the north, the UN says.