We developed a novel electrochemical sensor for the detection of alfuzosin (AFZ), a drug used to treat benign prostatic hyperplasia, using a double-shelled Co3O4/NiCo2O4 nanocomposite-modified electrode. The nanocomposites were synthesized using a template-assisted approach, with zeolitic imidazole framework-67 (ZIF-67) as the sacrificial template, involving the formation of uniform ZIF-67/Ni-Co layered double hydroxide (LDH) hollow structures followed by calcination to achieve the final nanocomposite. The nanocomposite was characterized by various techniques and showed high porosity, large surface area, and good conductivity. The nanocomposite-modified electrode exhibited excellent electrocatalytic activity towards AFZ oxidation, with a wide linear range of 5–180 µM and a low limit of detection of 1.37 µM. The sensor also demonstrated good repeatability, reproducibility, and stability selectivity in the presence of common interfering substances. The sensor was successfully applied to determine the AFZ in pharmaceutical tablets and human serum samples, with satisfactory recoveries. Our results suggest that the double-shelled Co3O4/NiCo2O4 nanocomposite is a promising material for the fabrication of electrochemical sensors for AFZ detection.