The center-right government proposed the bill in response to a series of cases in which fathers sexually abused their daughters. It also raises the maximum prison term for the rape of under-15s to 15 years from 12.
Under the law, approved overwhelmingly by parliament's lower house, people convicted of raping under-15s would be obliged to take drugs intended to control their sexual urges - a practice known as chemical castration.
The drugs would be administered at a prison hospital or medical center.
In cases where children between 15 and 18 are raped, the new law would leave it up to courts to decide whether the assailant should undergo chemical treatment.
The law also would apply to people who rape close relatives - a term that it does not define more specifically. It also does not say how old those relatives would have to be for obligatory chemical castration to apply.
Poland already offers the procedure on a voluntary basis. The bill still needs approval from the upper house of parliament and President Lech Kaczynski, both of which it can expect to receive.