Dimetridazole (DMZ), a nitroimidazole derivative, is a notable antibiotic that has garnered growing interest in the medical community owing to its noteworthy pharmacological and toxicological properties. Increasing interest is being directed toward developing high-performance sensors for continuous monitoring of DMZ in food samples. This research investigated an electrochemical sensor-based nano-sized ErVO4 attached to a sheet-like g-CN-coated glassy carbon electrode to determine dimetridazole (DMZ). The chemical structure and morphological characterization of synthesized ErVO4@g-CN were analyzed with XRD, FTIR, TEM, and EDS. Irregular shapes of ErVO4 nanoparticles are approximately 15 nm. Cyclic voltammetry (CV) and differential pulse voltammetry (DPV) were followed to examine the electrochemical performance in pH 7 phosphate buffer solution for higher performance. This electrochemical sensor showed a low detection limit (LOD) of 1 nM over a wide linear range of 0.5 to 863.5 µM. Also, selectivity, stability, repeatability, and reproducibility studies were investigated. Furthermore, this electrochemical sensor was applied to real-time milk sample analysis for the detection of analytes.