This study is devoted to the synthesis of a 40-membered macroheterocycle with its further nanostructuring by magnetite nanoparticles. The mentioned macroheterocycle was synthesized by the [2+2] cyclocondensation of the oxygen-containing diamine with an aromatic dialdehyde in a non-catalytic medium and with no work-up procedure. The structure of the obtained macroheterocycle was studied by 1H and 13C nuclear magnetic resonance spectroscopy and matrix-assisted laser desorption/ionization-time of flight mass spectrometry. Furthermore, the nanosupramolecular complex of macroheterocycles with magnetite nanoparticles was obtained and investigated by Fourier-transform infrared and ultraviolet-visible spectroscopy methods. Shifts in the infrared spectra of the nanosupramolecular complex indicate the interaction through metal-aromatic ring non-covalent bonding. The shift is also observed for the C-O-C stretching band of ether bonds. The loading rate of macroheterocycles on magnetite nanoparticles was 18.6%. The morphology of the ensemble was studied by transmission electron microscopy, which confirmed the synthesis of nanospherical particles with a diameter range of 10-20 nm. Powder X-ray diffraction analysis showed patterns of cubic Fe3O4 nanoparticles with a crystallite size equal to 9.1 nm. The macroheterocycle and its nanosupramolecular complex were tested against Klebsiella pneumoniae, Pseudomonas aeruginosa and Staphylococcus aureus. The results have shown that the created complex has shown 64 times better activity against Staphylococcus aureus in comparison with the individual macroheterocycle and 32 times better activity in comparison with the pristine antibiotic Ampicillin as a control. In addition, computational analysis of the macroheterocycle was performed at the B3LYP/6-31G level in water. Molecular docking analyses for the macroheterocycle revealed Penicillin-binding protein PBP2a (5M18) from the transpeptidase family as a target protein in Staphylococcus aureus.