Senator Byrganym Aitimova said that castration would be "temporary", consisting of a "one-time injection" based on "the necessity of preventing the man from (committing) sexual violence."
Any such decision would be provided by a court in consultation with a medical authority, according to the amendment.
The bill has been sent to the office of President Nursultan Nazarbayev for approval.
Paedophilia-related crimes carry sentences of up to 20 years in Kazakhstan.
Chemical castration is practised in many countries although nations that force sex offenders to accept the medication are in the minority.
Last year Kazakhstan's state prosecutor said there had been a spike in child rapes with figures doubling to almost 1,000 cases annually between 2010 and 2014.
The authoritarian Central Asian country's bicameral parliament largely serves to rubber- stamp policies made by the government.