Mustapha, who resides at Asada area of Sokoto, is facing a two-count of criminal conspiracy and preventing a child from being borne or causing it die after birth.
The accused pleaded guilty to the charge.
The Chief Magistrate, Abubakar Adamu, however, said the court lacked jurisdiction over the matter but ordered that the accused be remanded in prison custody.
Adamu adjourned the case until April 9 for a mention and possible transfer to a court of competent jurisdiction.
Earlier, the prosecutor, Cpl. Umar Rabiu, told the court that the accused committed the offences on March 3 at Asada area of Sokoto.
Rabiu said that the woman conceived out of wedlock and gave birth to a baby boy which she strangled to death and threw the body into a pit latrine.
He said the offence contravened Section 235 of the Penal Code.