Stem cells are regulated by signals from their microenvironment, or niche. During Drosophila hematopoiesis, a niche regulates prohemocytes to control hemocyte production. Immune challenges activate cell-signalling to initiate the cellular and innate immune response. Specifically, certain immune challenges stimulate the niche to produce signals that induce prohemocyte differentiation. However, the mechanisms that promote prohemocyte differentiation subsequent to immune challenges are poorly understood. Here we show that bacterial infection induces the cellular immune response by modulating occluding-junctions at the hematopoietic niche. Occluding-junctions form a permeability barrier that regulates the accessibility of prohemocytes to niche derived signals. The immune response triggered by infection causes barrier breakdown, altering the prohemocyte microenvironment to induce immune cell production. Moreover, genetically induced barrier ablation provides protection against infection by activating the immune response. Our results reveal a novel role for occluding-junctions in regulating niche-hematopoietic progenitor signalling and link this mechanism to immune cell production following infection.