This study aimed to assess and compare the shielding performance of boron-containing materials for neutrons generated in proton therapy and used in boron neutron capture therapy (BNCT). Five composites, including AlB2, Al-B4C, Al-TiB2, Al-BN, and Al-TiB2-BN, were selected as shielding materials, with concrete used as a benchmark. The mass fraction of boron compounds in these materials ranged from 10% to 50%. The Monte Carlo toolkit Geant4 was employed to calculate shielding parameters, including neutron ambient dose equivalent, dose values, and macroscopic cross-section. Results indicated that, compared to concrete, these boron-containing materials more effectively absorb thermal neutrons. When the boron compound exceeds 30 wt.%, these materials exhibit better shielding performance than concrete of the same thickness for neutrons generated by protons. For a given material, its shielding capability increases with boron content. Among the five materials when the material thickness and boron compound content are the same, the shielding performance for neutrons generated by protons, from best to worst, is as follows: Al-TiB2, Al-B4C, AlB2, Al-TiB2-BN, and Al-BN. For BNCT, the shielding performance from best to worst is in the following order: Al-B4C, AlB2, Al-TiB2, Al-TiB2-BN, and Al-BN. The results of this study provide references and guidelines for the selection and optimization of neutron shielding materials in proton therapy and BNCT facilities.