Graphene-based metamaterial sensors are of significant research value for detecting food preservatives at low concentrations due to their extremely high sensitivity levels. In this work, we proposed and experimentally demonstrated an anapole resonance-based graphene metasurface (An-graphene-Ms) sensor with its conductivity altered by electrostatic doping effects for detecting and differentiating between two preservatives, sodium benzoate and potassium sorbate, in the terahertz region. Sodium benzoate, owing to its benzene ring structure, established π–π stacking interactions between the π-electrons in the benzene ring and those in graphene, amplifying the sensing effect. The amplitude changes and phase differences of the An-graphene-Ms sensor for the sodium benzoate detection were greater than those for potassium sorbate at the same concentration. Additionally, to reveal the dependence of the resonance frequency on the time delay, the measured signals were investigated using the continuous wavelet transform (CWT), and the time-frequency combination of the metasurface sensor was performed. The 2D wavelet coefficient intensity cards are effectively constructed through CWT, which also presents a more accurate approach for distinguishing and determining the concentrations of the two preservatives.