The de-agrarianisation of the labor force in the poverty alleviation resettlement (PAR) inevitably influences households’ farmland management and farmland abandonment in the relocated areas. Drawing on survey data from 1079 households in Shaanxi, China, this study uses the Heckman two-stage model to empirically examine the relationship between non-farm employment and farmland abandonment in relocated areas. Additionally, it explores heterogeneity by considering the quantity and spatial distribution of non-farm employment, as well as the moderating effect of the withdrawal of rural homesteads (WRH). The results show that: (1) non-farm employment significantly promotes both behavioral and scale of farmland abandonment, with the magnitude of this impact varying based on the quantity of non-farm employment; (2) Heterogeneity analyses show that areas with non-farm employment exert a noteworthy positive effect on farmland abandonment. On average, farmers engaged in non-farm employment outside the county (NEO) exhibit a higher marginal effect on both behavioral and scale aspects of farmland abandonment compared to those engaged in non-farm employment within the county (NEI). Furthermore, only when the number of NEI reaches 3 does the probability and scale of farmland abandonment surpass those of NEO; (3) Mechanism analysis sheds light on the role of WRH, indicating that the cultivation of land in WRH weakens the promotion of farmland abandonment by non-farm employment, particularly in the NEI group. Conversely, the duration of WRH strengthens the contributions of non-farm employment to farmland abandonment, and this effect is concentrated in the NEO group. These findings underscore the importance of actively cultivating and introducing new types of agricultural management entities, promoting the moderate-scale operation of farmland, and encouraging the recultivation of withdrawn rural homesteads as strategies to curb farmland abandonment.