Overlay alignment is a concern for nanolithography applications, in particular, for those using step and repeat techniques targeting next-generation lithographic applications. In this context, a new method and a proof of concept (POC) setup for accurately aligning a mask with a semiconductor wafer is presented. Utilizing active scanning probe technology, the method is employable for various lithographic techniques such as photolithography, electron- and ion-beam lithography, nanoimprint lithography (NIL). The developed method is demonstrated in the example of NIL. It employs compact highly integrated atomic force microscopes (mini-AFM), which are fixed on the lithographic template. The mini-AFM systems are applied for imaging of the surface relief marks on the semiconductor wafer to carry out the alignment process. In a next step, the obtained AFM section images are used to calculate the deviations and steer the bottom stage carrying the processed wafer in order to achieve the desired positioning accuracy. A POC test setup was built for emulation of the alignment procedure. Several measurement studies are addressed to evaluate the applicability of the overlay alignment method. As a result, it is shown that the implemented test setup is able to determine the positioning error of the bottom stage carrying the wafer with an accuracy of around 10 nm (without temperature compensation).