I think you will have to use binary variables, but I haven't implemented it in CasADI before myself. Basically, you create a binary variable B (in dimension [1,10])
B.T @ x <= 0 (10 Inequality constraints, will always be 0 when B_i is 0)
B.T @ y - 5 <= 0 (Will also be fulfilled when B_i is 0, depends on y when B_i = 1)
0 - B.T @ y <= 0
It requires a solver which handles binary variables, like bonmin.
Regards,
Jonas Hjulstad