Section 361(Exception) in The Indian Penal Code, 1860
(Exception)— This section does not extend to the act of any person who in good faith believes himself to be the father of an illegitimate child, or who in good faith believes himself to be entitled to lawful custody of such child, unless such act is committed for an immoral or unlawful purpose.