In-sewer stability of human excreted biomarkers is a critical factor of wastewater-based epidemiology in back-estimating illicit drug and pharmaceutical use in the community. Biomarker stability has been investigated in sewers with the presence of biofilms, but the understanding in sewer sediments is still lacking. This study for the first time employed a laboratory sediment reactor to measure 18 illicit drug and pharmaceutical biomarkers under gravity sewer environments with the presence of sediments. Biomarkers exhibited various stability patterns due to transformation processes occurring in the bulk wastewater and sediments. The attenuation of a biomarker by sediments is driven by complex processes involving biodegradation, diffusion, and sorption, which is directly proportional to the ratio of sediment surface area against wastewater volume. The sediment-driven transformation coefficients of biomarkers are higher than the accordingly biofilm-mediated rates because of stronger microbial activities in sediments. Additionally, the stability of most biomarkers was insensitive to the natural pH variation in sewers, except for a few compounds (e.g., methadone, ketamine, and paracetamol) susceptible to pH changes. In general, this study delineates the stability data of various biomarkers in gravity sewers with sediments, which are novel and long-missing information for wastewater-based epidemiology and improve the reliability of back-estimation in complex sewer networks.