With the continuous advancement of integrated circuit technology nodes, the degree of chip integration is increasing, and the requirements for critical dimensions and overlay errors are becoming more and more stringent. In recent years, near-field lithography technologies such as nanoimprint lithography and plasmonic lithography have made rapid progress; however, the challenge of compensating for their overlay has yet to be solved or systematic reports are lacking. This work offers an overlay compensation approach based on the theory of overlay and mask stress mechanics and thermodynamics by providing stress to the mask. The overlay analysis model and correction feedback mechanism based on mask compensation technology is carried out theoretically. This work establishes the relationship between the overlay compensation parameters and the mask stress by using strict calculation methods, quantitative characterization, and combining sensitivity analysis methods. Theoretical verification of various overlay distribution patterns demonstrates the efficiency of this feedback compensation strategy as well as the quantitative analytical calculation. It is verified that, under ideal conditions, the feedback technique may minimize the overlay error caused by mask thermal effects to ∼1.5 nm. This research presents a quantitative control mechanism for reducing overlay for near-field lithography, and it has substantial guiding implications for traditional lithography quantitative research on the influence of mask stress or temperature on overlay.