Although the accused denied committing the offence, the Chief Magistrate, Olufunke Sule-Amzat, ordered that he be remanded in prison, pending advice from the State Director of Public Prosecutions (DPP).
She adjourned the case until April 8 for hearing.
The accused, whose address was not given in court, was docked for rape.
Earlier, the prosecutor, Benson Emuerhi, told the court that the offence was committed on January 3, between 5.00 p.m. and 6.00 p.m. at No. 4, Alahun Osunba St., at Mazamaza area of Lagos.
He told the court that the incident was reported by a neighbour at the Mazamaza Police Station.
He alleged that the accused unlawfully ‘defiled’ the six-year-old girl, by forcefully having sexual intercourse with her.
The offence, Mr Emuerhi said, contravened Section 137 of the Criminal Law of Lagos State, 2015 (Revised).
The News Agency of Nigeria (NAN) reports that the section prescribes life sentence for offenders.