In this contribution we report on research of the interaction between optical near-fields of periodic nanostructures and free-electron beams with potential application in future miniaturized laser-based accelerating devices [1, 2], in ultrafast electron microscopy or diffraction experiments [3, 4] or in photon-induced near-field electron microscopy [5]. Here we experimentally demonstrate a technique allowing sub-optical cycle temporal gating and streaking of electrons at sub-relativistic energies (25–30 keV). A focused electron beam interacts with the near-field mode induced by infrared femtosecond laser pulses on the surface of a silicon nanograting. The field pattern above the surface of a periodic structure can be decomposed to its spatial Fourier components, which propagate along the surface with different phase velocities. Synchronization of the phase velocity of a particular spatial harmonic with the velocity of the co-propagating electrons leads to efficient energy transfer between the laser field and electrons [1, 2]. As this interaction is linear in electric field, the temporal structure of the oscillating electromagnetic field of the femtosecond laser pulse is imprinted to the electron beam energy and/or transverse momentum with sub-cycle precision (200 as in this experiment [6]).