We demonstrate that an intercalated Co atom in superconductor NbSe2 could control the magnetic interaction between the adsorbed magnetic molecule of TbPc2 and the NbSe2 substrate. An intercalated Co atom enhances the magnetic interaction between the NbSe2 and the TbPc2 spin to cause Kondo resonance at the TbPc2 position, a spin-singlet state formed by the itinerary electron. By applying a surface-normal magnetic field, we change the molecule's spin direction from the initial one directed to the Co atom to the surface normal. The change appears as a split Kondo resonance at the TbPc2, one of which is enhanced at the Tb site, which disappears when the outer magnetic field normal to the surface is applied and never appears, even if we return B to 0 T. The phenomenon suggests that the intercalated magnetic atoms can control the magnetic interaction between a magnetic molecule and the superconductor NbSe2.