The extremist group announced its claim of Wednesday’s attack in a statement carried by its Aamaq news agency. The authenticity of the statement could not be verified but it was released on Telegram, as similar claims have been in the past.
The attack involved an ambush against a border guard checkpoint west of the Mediterranean city of Rafah, which borders the Gaza Strip.
The military said at least five troops, including an officer, were killed in the attack. At least seven militants were also killed, it said.
It was the second militant attack in less than a week.
Last Saturday, at least 11 troops were killed, in one of the deadliest attacks on Egyptian security forces in recent years.
ISIS also claimed that attack, which took place in the town of Qantara in the province of Ismailia, which stretches eastwards from the Suez Canal.
Egypt is battling an insurgency in Sinai that intensified after the military overthrew elected but divisive Islamist president Mohammed Morsi in 2013.
Extremists have carried out scores of attacks since, mainly against security forces and Christians, but the pace has slowed in recent years.