In this paper, dynamic behavior of multi-layered viscoelastic nanobeams resting on a viscoelastic medium with a moving nanoparticle is studied. Eringens nonlocal theory is used to model the small scale effects. Layers are coupled by Kelvin-Voigt viscoelastic medium model. Hamilton's principle, eigen-function technique and the Laplace transform method are employed to solve the governing differential equations. Analytical solutions for transverse displacements of double-layered is presented for both viscoelastic nanobeams embedded in a viscoelastic medium and without it while numerical solution is achieved for higher layered nanobeams. The influences of the nonlocal parameter, stiffness and damping parameter of medium, internal damping parameter and number of layers are studied while the nanoparticle passes through. Presented results can be useful in analysing and designing nanocars, nanotruck moving on surfaces, racing nanocars etc.