Proper way to route high-voltage tracks near THT components
If you can't modify the PCB layout to provide the necessary clearance, you could coat the PCB after assembly with something like Corona Dope which has a high dielectric strength.