They are two different places, so no, it does not do anything. It's like hitting Australia in order to contain the USA. There is no real containment, as they are two different countries. It would just make people mad. Any benefits towards containment would be so minimal it would not be realistic to call it that.
There is no reason to add fuel to the flames. Gaza's terrorist party, Hamas, is strongly supported by Iran, thus by attacking Gaza, Israel will upset Iran, not contain it. Iran supports Hamas, but is much larger than Hamas. The Iranian leadership calls for attacks on Israel, based on a religious obligation to the people of Palestine. Israel attacking Gaza will not contain Iran, but only anger the Iranian people and their leaders.
While a superficial analysis of the similarities between Palestine and Iran may suggest the two are similar, despite their common religion each governing regime is sovereign in its own territory and is not directly connected to another. So Israel's attacks against Palestine cannot reasonably be considered to have any meaningful impact on negotiations with Iran.