Accurate description of nonadiabatic dynamics of molecules at metal surfaces involving electron transfer has been a long-standing challenge for theory. Here, we tackle this problem by first constructing high-dimensional neural network diabatic potentials including state crossings determined by constrained density functional theory, then applying mixed quantum-classical surface hopping simulations to evolve coupled electron-nuclear motion. Our approach accurately describes the nonadiabatic effects in CO scattering from Au(111) without empirical parameters and yields results agreeing well with experiments under various conditions for this benchmark system. We find that both adiabatic and nonadiabatic energy loss channels have important contributions to the vibrational relaxation of highly vibrationally excited CO(v_{i}=17), whereas relaxation of low vibrationally excited states of CO(v_{i}=2) is weak and dominated by nonadiabatic energy loss. The presented approach paves the way for accurate first-principles simulations of electron transfer mediated nonadiabatic dynamics at metal surfaces.