Metal sulfides for hydrogen evolution catalysis typically suffer from unfavorable hydrogen desorption properties due to the strong interaction between the adsorbed H and the intensely electronegative sulfur. Here, we demonstrate a general strategy to improve the hydrogen evolution catalysis of metal sulfides by modulating the surface electron densities. The N modulated NiCo2S4 nanowire arrays exhibit an overpotential of 41 mV at 10 mA cm-2 and a Tafel slope of 37 mV dec-1, which are very close to the performance of the benchmark Pt/C in alkaline condition. X-ray photoelectron spectroscopy, synchrotron-based X-ray absorption spectroscopy, and density functional theory studies consistently confirm the surface electron densities of NiCo2S4 have been effectively manipulated by N doping. The capability to modulate the electron densities of the catalytic sites could provide valuable insights for the rational design of highly efficient catalysts for hydrogen evolution and beyond.