Rapidly growing demand for cobalt and nickel in rechargeable battery industry promotes research on metallogenic theory of magmatic Cu-Ni-Co sulfide deposits. Xiarihamu Cu-Ni-Co deposit, one of the lately discovered Co-rich magmatic sulfide deposits in China, is typical of distribution in orogenic belts, rather than in divergent tectonic settings as many deposits of the same type. In-situ elemental and sulfur isotopic analyses of base metal sulfides (BMS; pyrrhotite, pentlandite, and chalcopyrite) from Xiarihamu were conducted in this study. The strongly negative correlation between Fe and Co + Ni reveals the major occurrence of Co and Ni as isomorphism states in pentlandite and pyrrhotite. The δ34S values of pentlandite and pyrrhotite generally increase with Co contents and Co/Ni ratios, indicating that the Co enrichment within BMS accompanied with enhanced contamination of crustal sulfur. Zinc, Cd, Sb, and Te are significantly and preferentially fractionated into intermediate sulfide solution (ISS) from which chalcopyrite exsolved. The Se contents and Se/S ratios of pentlandite and pyrrhotite in lherzolite/harzburgite are much higher than those of BMS from gabbro, which has systematically higher δ34S values. Combined with the partially overlapped Sb/Se and As/Se ratios of BMS from lherzolite and gabbro, as well as similar calculated R factors of ore-hosting peridotite and gabbro, it is proposed that the studied Xiarihamu gabbro was crystallized from a separate pulse of Co-Ni-enriched, Se-depleted and intensively contaminated mafic parent magma, rather than evolved from ultramafic magma through crystallization fractionation. The lack of olivine and spinel in gabbro also promoted more Co and Ni into sulfide liquid. Based on Se/Te ratios, the pentlandite and pyrrhotite from drill core XH1E01S was originated from sulfide liquid, which suffered higher degree of crystallization fractionation of monosulfide solution (MSS). While pentlandite and pyrrhotite that crystallized from less evolved parent sulfide liquid bear less cobalt, such as those collected from drill core XH1109. This study strengthens the potential importance of crustal contamination and crystallization fractionation of MSS from sulfide liquid during Co enrichment within BMS (pentlandite and pyrrhotite).