For non-promoted raids, the number of perfect IVs in raids is equal to the number of stars minus 1, so a 5-star raid has at least 4 perfect IVs. This is true for both regular red beams and rare purple beams.
However, if a Pokémon is being promoted by an event, then the number of guaranteed IVs is just the number of stars, which would give a 5-star promoted raid at least 5 perfect IVs.