Bacillus subtilis is a soil bacterium that is competent for natural transformation. Genetically distinct B. subtilis swarms form a boundary upon encounter, resulting in killing of one of the strains. This process is mediated by a fast-evolving kin discrimination (KD) system consisting of cellular attack and defence mechanisms. Here, we show that these swarm antagonisms promote transformation-mediated horizontal gene transfer between strains of low relatedness. Gene transfer between interacting non-kin strains is largely unidirectional, from killed cells of the donor strain to surviving cells of the recipient strain. It is associated with activation of a stress response mediated by sigma factor SigW in the donor cells, and induction of competence in the recipient strain. More closely related strains, which in theory would experience more efficient recombination due to increased sequence homology, do not upregulate transformation upon encounter. This result indicates that social interactions can override mechanistic barriers to horizontal gene transfer. We hypothesize that KD-mediated competence in response to the encounter of distinct neighbouring strains could maximize the probability of efficient incorporation of novel alleles and genes that have proved to function in a genomically and ecologically similar context.