This paper deals with the pull-in control and the nanopositioning of an electrostatically actuated NEMS (Nano Electromechanical System) squeezed between two forces. It is shown that when a position sensor is driven close to a NEMS, pull-in occurs due to electrostatic forces, but also to near field forces acting at nanoscale, namely Casimir and Van der Waals forces. Pull-in conditions are investigated to find the minimum pull-in distance depending on the parameters of the system. This paper aims to demonstrate that the sensor can be driven below this minimum pull-in distance. To do so, a control strategy based on a nonlinear feedback design and on a robust pole placement/sensitivity function shaping is proposed. Furthermore, it is shown that the NEMS position can be controlled without contact while avoiding pull-in and decreasing its natural brownian motion.