Electrochemical nitrate reduction reaction (NO3RR) offers a promising alternative for ammonia production using electricity generated from renewable energy sources. Active electrocatalysts with high selectivity and high yield are required to selectively catalyze NO3RR to ammonia. Here, P-doped Cu0.51Ni0.49 alloy thin films are electrodeposited from a deep eutectic solvent of choline chloride-ethylene glycol (ChCl/EG). The P-Cu0.51Ni0.49 produces 1616.94 µg h-1 cm-2 of ammonia at -0.55 VRHE (V versus reversible hydrogen electrode), with a Faradaic efficiency of 98.38% and ammonia selectivity of 97.84% at -0.25 VRHE, much better than the P-Ni and P-Cu prepared under similar condition. The high ammonia production rate, Faradaic efficiency and selectivity are originated from high number of electrochemically active sites and more facile kinetics. Mechanistic study and density functional theory calculation proves that P-Cu0.51Ni0.49 exhibits higher conductivity and more facile NO3 - adsorption compared to P-Ni and P-Cu, induced by the electron interaction. Characterizations after NO3RR cycling show that the crystallinity of P-Cu0.51Ni0.49 decreases, with the content of divalent metal ions increases at the surface. The P-Cu0.51Ni0.49 is an active and stable material to electrocatalyze NO3RR to ammonia in neutral aqueous solutions.