The discovery of intrinsic magnetism within a single molecule has attracted significant interest. However, progress in the applications of nanospintronics using molecular magnets has been sluggish due to stability issues with both the devices and their performance. In this study, we propose a promising approach to protect magnetic molecules from the environment by encapsulating them in nanoscale tubular holes of carbon tubes. An atomic-resolution scanning transmission electron microscopy (STEM) image revealed that dysprosium chloride encapsulated in CNT forms a one-dimensional chain with a compressed layer gap compared to the bulk sample. Charge transfer between the SWCNT and dysprosium chloride chains has been confirmed through optical characteristics, X-ray photoelectron spectroscopy measurements, and DFT calculations. The magnetic chain exhibits distinct quantum spin dynamics compared to those of the bulk sample. This distinction is primarily due to the modulation of magnetic anisotropy in Dy(III) ions, which is facilitated by charge transfer and structural alterations. Our work provides insights into the interaction between inner encapsulated spins and CNT, establishing the groundwork for electrical spin manipulation in new "spintronics double quantum dot" CNT nanodevices.