The constitutional court ruled on Tuesday that the first article of the law, which allowed the suspension of ongoing trials against the five, even for crimes allegedly committed before taking office, was "illegitimate" and violated the principle of equality among citizens.
As a result of the law a trial was suspended in Milan where Berlusconi faced charges of bribing judges in a 1985 business deal.
The other four beneficiaries of the law, passed in June in record time - just three weeks - are the president, the speakers of the upper and lower houses of parliament and the president of the constitutional court.
Critics say parliament passed the controversial immunity bill to save Italy embarrassment while it held the rotating EU presidency, a six-month rotating position which ended on 1 January when Ireland took it over.
"It's good news because we have always said that this law is unconstitutional and immoral," said Antonio di Pietro, former star judge in the Mani Pulite (Clean Hands) anti-corruption campaign of the 1990s, who is now head of a political party, Italy of Values.