The application of biogas slurry in agriculture production is regarded as a sustainable method for mitigating the environmental impacts of fertilization. To investigate the effects of biogas slurry application on soil nitrogen loss and crop yield, a field plot experiment was conducted within a wheat–maize rotation system. This study assessed the effects of three levels of biogas slurry nitrogen substitution, 50% (BSF), 100% (BS), and 150% (EBS), on the yield of silage maize and wheat, nitrogen use efficiency, and soil nitrogen loss. The findings revealed that in the first year (characterized by high rainfall), the application of the biogas slurry led to increased NH3 emissions and nitrogen leaching, resulting in a notable rise in the annual nitrogen loss. Additionally, it was observed that as the amount of applied biogas slurry increased, the nitrogen loss also rose correspondingly. However, in the second year (a period of drought conditions), despite the elevated NH3 emissions from the biogas slurry, there was a significant reduction in nitrogen leaching, which resulted in reductions of 14.2% and 20.0% in annual nitrogen loss for the BSF and BS treatments, respectively, with comparable nitrogen input to the fertilizer treatment. Throughout both years, the application of biogas slurry did not decrease the yield of silage maize and wheat, and notably, the BS treatment even enhanced the crop nitrogen utilization efficiency. Compared with other nitrogen fertilizer treatments, the EBS treatment did not increase crop yield even with an increased nitrogen application rate; it also reduced the nitrogen utilization efficiency and N loss. In conclusion, employing biogas slurry to replace chemical fertilizer (equivalent nitrogen substitution) during drought years can enhance nitrogen utilization efficiency, reduce nitrogen loss, and sustain crop yield. When applying biogas slurry in years with substantial rainfall, effective measures should be implemented to mitigate nitrogen loss.