Though he denied committing the offence, the Chief Magistrate, Mr Tajudeen Elias, ordered his remand in prison custody.
He adjourned the case until Feb. 28 for ruling in his bail application and further hearing.
The defendant was charged with unlawful sexual intercourse.
The prosecutor, Kehinde Omisakin, said that the defendant committed the offence on Jan. 23, about 5.00 p.m., at Ilaje Otunmare in Ebute Meta.
The prosecutor alleged that the defendant defiled the 5-year-old girl on the said date.