This investigation reports the electrochemical preparation of a polypyrrole/triiron tetraoxide (PPY/Fe3O4) nanocomposite from deep eutectic solvents (DESs), and their application as novel sensor electrodes to determine certain pharmaceutical formulations using cyclic voltammetry (CV). The modified polypyrrole/Fe3O4 nanocomposite was characterized using transmission electron microscopy (TEM), scanning electron microscopy (SEM), energy dispersive X-ray analysis (EDAX), X-ray diffraction (XRD), and Fourier-transform infrared (FTIR) spectroscopy. These techniques confirmed the incorporation of Fe3O4 into the polypyrrole composite. Cyclic voltammetry and electrochemical impedance spectroscopy (EIS) indicated that PPY/Fe3O4 shows higher redox currents and greater electrical conductivity with procaine hydrochloride than other pharmaceutical formulations (ascorbic acid, diclofenac, losartan potassium, adiphenine hydrochloride, and metformin hydrochloride). Factors that could influence the determination of procaine hydrochloride, including pH, temperature, scan rate, concentration of drug, stability, and reproducibility, have all been optimized. Under optimal conditions, the calibration curve shows a linear relationship between oxidation peak current and procaine hydrochloride concentrations (between 0.005 and 0.3 mol/L), with an R2 of 0.9943. The limit of detection (LOD) was 0.0024 mol/L and the limit of quantification (LOQ) was 0.0079 mol/L. The modified sensor (PPY/Fe3O4) constructed in this study was successfully used for the determination of procaine hydrochloride drug concentrations in a procaine-penicillin pharmaceutical product.