We present an investigation into the intrinsic magnetic properties of the compounds YCo5 and GdCo5, members of the RETM5 class of permanent magnets (RE = rare earth, TM = transition metal). Focusing on Y and Gd provides direct insight into both the TM magnetization and RE-TM interactions without the complication of strong crystal field effects. We synthesize single crystals of YCo5 and GdCo5 using the optical floating zone technique and measure the magnetization from liquid helium temperatures up to 800 K. These measurements are interpreted through calculations based on a Greens function formulation of density-functional theory, treating the thermal disorder of the local magnetic moments within the coherent potential approximation. The rise in the magnetization of GdCo5 with temperature is shown to arise from a faster disordering of the Gd magnetic moments compared to the antiferromagnetically aligned Co sublattice. We use the calculations to analyze the different Curie temperatures of the compounds and also compare the molecular (Weiss) fields at the RE site with previously published neutron scattering experiments. To gain further insight into the RE-TM interactions, we perform substitutional doping on the TM site, studying the compounds RECo4.5Ni0.5, RECo4Ni, and RECo4.5Fe0.5. Both our calculations and experiments on powdered samples find an increased/decreased magnetization with Fe/Ni doping, respectively. The calculations further reveal a pronounced dependence on the location of the dopant atoms of both the Curie temperatures and the Weiss field at the RE site.