Isis claimed Saturday's car bombing on the city centre complex in the first such attack on a foreign mission in Egypt since the army ousted Islamist president Mohamed Morsi in July 2013.
"This attempt to strike at Egypt-Italy cooperation will fail. We will continue to work together, whether for counter-terrorism or for peace," Gentiloni said at a joint news conference in Cairo with his Egyptian counterpart Sameh Shoukri.
Gentiloni called the consulate bombing a symbolic attack on Egyptian-Italian relations, "especially in counter-terrorism".
He did not elaborate on the nature of such work the two countries were involved in.
His remarks came a day after Italian Prime Minister Matteo Renzi hailed Egyptian President Abdel Fattah al-Sisi as the only leader who can "save" Egypt, and vowed that Rome would not be intimidated.
Shoukri said investigations were continuing to find those behind the attack, which was claimed by Isis.
He said many militant groups were attracted to Isis and were pledging their allegiance to the jihadists.
"But this does not necessarily mean they are part and parcel of Daesh," he said, referring to Isis by its Arabic acronym.
Experts say the attack on the consulate was a message to Cairo's Western allies, and showed that IS had stepped up its campaign against Sisi's regime.
The attack came less than two weeks after suspected militants assassinated Egypt's top prosecutor in a Cairo car bombing.
Isis is spearheading an Islamist insurgency against Egypt's security forces, mostly in the Sinai Peninsula, in retaliation for a government crackdown targeting Morsi supporters.
Morsi, Egypt's first freely elected president, was overthrown by then army chief Sisi.
Hundreds of the jailed Islamist's supporters have been killed and thousands more imprisoned in an ensuing government crackdown.