A strategy for optical microscopy of high-aspect-ratio (HAR) nanoelectromechanical systems (NEMS) that combine large feature spacing and large height with subwavelength width is presented. Line images are simulated using a 2D model of incoherent imaging based on modal diffraction theory. Beyond a sufficient depth, it is shown that sub-wavelength features appear as dark lines, while wider features are visible as their edges. The results suggest NEMS and MEMS may be separated from background in images by detection of valleys in brightness. Results are confirmed by imaging of Si NEMS containing 100 nm wide features in a bright-field microscope. Algorithms for separation of NEMS, MEMS and background in microscope images based on valley detection, thresholding and masking are demonstrated.