Commercial N52 sintered NdFeB magnets were processed by grain boundary diffusion (GBD) with Dy-Co-M (M=Cu, Al) alloys. The coercivity of magnets greatly increase to 17.62 and 18.83 kOe respectively when diffusing Dy58Co25Cu17 and Dy58Co25Al17 alloys, which are obviously higher than that of Dy58Co42 GBD-treated magnet with 16.64 kOe. Further thermal stability studies indicate that the thermal stability of Dy58Co25Cu17 and Dy58Co25Al17 GBD-treated magnets is further improved compared to the Dy58Co42 GBD-treated magnet. The results show that the temperature coefficients of remanence (20–120 °C) are reduced from –0.148%/°C to –0.134%/°C and –0.132%/°C by Dy58Co25Cu17 and Dy58Co25Al17 GBD-treatment, respectively. Besides, the irreversible magnetic flux losses (120 °C) for Dy58Co25Cu17 and Dy58Co25Al17 diffusion magnets are 4.76% and 2.79%, respectively. Microstructural analyses demonstrate that the presence of Cu and Al elements reduces the excessive accumulation of Dy and Co on the surface in the diffusion magnets and improves the diffusion depth and utilization of Dy and Co. Furthermore, the flow of Co from the triple junction phase to the thin grain boundary phase is promoted, which contributes to the uniform distribution of Co. In addition, the dynamic evolution of the magnetic domain structure during the temperature rise process was studied. This work provides insight into the preparation of high-performance and high-thermal stability magnets.