The increase in pharmaceutical contamination has become a pressing environmental issue that poses a threat to public health on a global scale and has a far-reaching impact on the existence of every corner of the world. Its extensive consumption and improper disposal lead to various adverse effects on humans, animals and the environment. Herein, we present a novel approach for the electrochemical sensing of dimetridazole (DMZ) using a graphitic carbon nitride-rhenium disulfide (CN-ReS2) composite. Dimetridazole is an antimicrobial medication used in animal feed and used as a drug in human and veterinarian medicine to treat protozoal infections. Considering its negative impacts, it is highly essential to detect the presence of DMZ in our bodies and the environment. It is noteworthy that this is the first time, CN-ReS2 is being reported for electrochemical sensing applications. The CN-ReS2 composite was synthesized using a one-step hydrothermal method and the material characterization revealed that ReS2 forms flower-like structures on the flaky sheets of CN. The CN-ReS2 composite demonstrated enhanced electrochemical activity towards the reduction of dimetridazole in addition to its high operational and storage stability. The electrocatalytic activity of the composite was optimized by the precise tuning of the CN and ReS2 weight ratios and it was found that 3% ReS2 (CN-ReS2-3) shows an enhanced electrochemical response. The developed sensor displayed a promising limit of detection of 19.8 nM in a wide linear range of 50-1000 nM and with a good sensitivity of 0.246 μA nM−1 cm−2. The developed sensor also showed rapid detection (within 5 s), excellent selectivity, storage stability, repeatability, reproducibility and flexibility in addition to real sample applications. A prototype of the sensor was also made and the response was evaluated with a conventional three-electrode sensor. The results of this study suggests that CN-ReS2 has great potential for use as an immobilization platform for highly sensitive and selective electrochemical sensing applications. © 2023 RSC.