Just war theory requires the defender to be proportionate in response to provocation, although what exactly is proportionate hasn't been well defined. I think in the case of an occupying power acting in self defense such as responding to terrorist acts, it should be possible to define proportionality more specifically: the occupier has no right to inflict more deaths upon the civilian occupied population than the occupier itself has suffered.
A number of reasons support this argument - the occupier has the moral obligation to protect the innocent in the occupied region instead of making the innocent suffer in order to protect a smaller number of people elsewhere. The occupation itself may be a contributing factor for the attacks on the occupier, and the length of time of the occupation gives increasing responsibility to the occupier for the conditions that created the problem.
These reasons boil down to the occupier having the most power of anyone involved, including the power to leave. The occupier might deny that the choice to leave is feasible, but to a large extent, that's a problem that the occupier has either created or maintained over time.
This idea was inspired by the Gaza mess, where the Israelis have killed hundreds of innocents so far in response to a dozen or two killed by terrorists, but it only partially applies to the partial occupation Israel had in partially controlling Gaza's borders. Even under the traditional ambiguity of proportionality, though, I think Israel's gone too far.
I wish I knew a complete answer to the problem there. I feel like Israel has done its utmost to turn the Palestinian population into monsters, and it has succeeded to a tragic extent.