He says three were killed Thursday and two soldiers died Friday from wounds, bringing death toll to five.
The official says it is not yet clear who shot the soldiers, but "most probably" they were caught in the crossfire when Israeli soldiers were chasing militants after they ambushed civilian vehicles traveling on a remote road, killing eight people.
The gunmen appear to have crossed into southern Israel through Egypt's Sinai desert.
The official spoke on condition of anonymity because he was not authorized to speak to reporters.