On the basis of the structural interactions between diphenhydramine (DPH) and ephedrine (EPH) to enhance electrochemiluminescence (ECL) intensity, a flow-injection ECL analysis of DPH in the present of EPH by utilizing tris(2,2,-bipyridine)ruthenium(II), (Ru(bpy)32+) has been reported. In the optimized experimental conditions, the linear ECL response to concentrations of DPH is from 2.00 to 40.0 pg/L with a correlation coefficient of 0.9995 and a detection limit of 1.20 pg/L. The relative standard deviation (RSD) was less than 4.6% (n = 5) and the recovery was in the range of 98–106% for the determination of DPH in pharmaceutical samples. The method avoids any interference of coexistent EPH in the compounding drug without prior separation. The method has advantages over HPLC method in terms of speed and convenience, economics and safe procedure, and could be an alternative for places where HPLC equipment is not available.