To address the issues arising from residual stress, structural non-uniformity, and component segregation in AZ91D magnesium alloy automotive differential brackets, this study comprehensively investigates the phenomenon of component segregation and the influence of heat treatment on the microstructure and mechanical properties of near-liquidus squeeze casting (NLSC) of the AZ91D alloy. The results indicate that significant variations in cooling rates occur during alloy solidification along the casting and mold wall directions, leading to the predominant alloying elements segregating into individual clusters and promoting the primary presence of the non-equilibrium Mg17Al12 phase. By subjecting key components of the automotive differential bracket produced through NLSC of the AZ91D alloy to heat treatment, one can see that the solid solution treatment at 430 degrees C for 12 h alleviates the segregation phenomenon in the as-cast alloy, allowing the Mg17Al12 phase to basically integrate into the matrix to form a supersaturated solid solution. After aging at 330 degrees C for 21 h, the microstructure precipitates small and dispersed nanoscale short rod-shaped Mg17Al12 second phase. Compared with as-cast alloys, the ultimate tensile strength and elongation after aging have increased from 229.2 MPa to 3.43% to 256 MPa and 3.41%, respectively. Although the elongation change is not significant, its strength has significantly improved. Research has revealed that heat treatment has strong potential in strengthening NLSC forming AZ91D alloy castings.