We are not talking about filtering noise, we are talking about absorbing the energy that is induced onto the Switched Live by the stray capacitance in the cables.
Y1 would be better Y1 class capacitors are rated up to 500 Vac, with a peak test voltage of 8 kV. Y2 capacitors have 150 to 300 Vac ratings and a peak test voltage of 5 kV.
From
HERE
When does capacitor reliability become critical to safety?
Line filter capacitors are classified either as X-capacitors or Y-capacitors. X-capacitors are connected between line and neutral, to protect against differential mode interference. Their failure does not create conditions for dangerous electric shock, although it can create a fire risk. However Y-capacitors are designed to filter out common-mode noise, and are connected between line and chassis; if they short-circuit, they create a risk of shock to the user.
How are Y-Capacitors designed and deployed to ensure safety?
Y-capacitors are designed to enhanced electrical and mechanical reliability standards. Capacitance values are also limited to reduce the current passing through the capacitor when AC voltage is applied, and reduce the energy stored to a safe limit when DC voltage is applied. Capacitors must be tested to applicable standards to qualify them for use as Y-capacitors.