Production of defects under electron irradiation in a transmission electron microscope (TEM) due to inelastic effects has been reported for various materials, but the microscopic mechanism of damage development in periodic solids through this channel is not fully understood. We employ non-adiabatic Ehrenfest, along with constrained density functional theory molecular dynamics, and simulate defect production in two-dimensional MoS2 under electron beam. We show that when excitations are present in the electronic system, formation of vacancies through ballistic energy transfer is possible at electron energies which are much lower than the knock-on threshold for the ground state. We further carry out TEM experiments on single layers of MoS2 at electron voltages in the range of 20-80 kV and demonstrate that indeed there is an additional channel for defect production. The mechanism involving a combination of the knock-on damage and electronic excitations we propose is relevant to other bulk and nanostructured semiconducting materials.