Not sure what the gap is between the back of the light and the rear panel but have you tried something like this:
https://rover.ebay.com/rover/0/0/0?m...2F282259968136
When I put a new rear light in my old Nissan it came with a roll of this in the box, it's a bead of bitumen sealant you put round the light cluster where it meets the metal bodywork and seals everything up watertight.