Bathing becomes necessary due to semen discharged out of lust and sensual arousal. In case of masturbation also the semen is discharged with lust (shahwah) so Ghusl (taking bath) will be compulsory; it will not suffice to wash from waist to toes. He will be pure only after Ghusl and then only he can pray salah.
Allah (Subhana Wa Ta’ala) knows Best
Darul Uloom Deoband