In nature, bacteria are predominantly found in architecturally complex, multicellular and often multispecies communities called biofilms. The soil bacterium Bacillus subtilis forms biofilms in close association with plant root surfaces. B. subtilis is an efficient biocontrol agent, protecting the plants by producing a large arsenal of different antibiotics, including non-ribosomal peptides (NRP). Here, we studied the contribution of NRP antibiotics during interspecies competition against other bacilli spread across different phylogenetic distances. We found that the toxicity of B. subtilis towards competing biofilms was low for phylogenetically close bacilli subtilis clade (self), but increased against phylogenetically distant bacilli (non-self). To determine the relative contribution of each NRP antibiotic, we monitored competition between deletions mutants missing one or more NRPs against bacilli. We found that the toxicity of B. subtilis was primarily dependent upon surfactin, bacillaene and bacilysin, while plipsatatin contributed to a lesser extent. Finally, transcription analysis of the NRP promoters during competition revealed that the transcription of NRP antibiotics increased when competing against distant bacilli. Coupling antibiotic production and sensing self/non-self might allow B. subtilis to form successful multispecies biofilms composed of compatible community members, while reducing the fitness cost of antibiotics production. Our research can potentially unravel new mechanisms that govern complex bacterial interactions.