This multidisciplinary study details the biosynthesis of novel non-digestible oligosaccharides derived from rare sugars, achieved through transfructosylation of D-tagatose and L-sorbose by levansucrase from Bacillus subtilis CECT 39 (SacB). The characterization of these carbohydrates using NMR and molecular docking was instrumental in elucidating the catalytic mechanism and substrate preference of SacB. Tagatose-based oligosaccharides were higher in abundance than L-sorbose-based oligosaccharides, with the most representative structures being: β-D-Fru-(2→6)-β-D-Fru-(2→1)-D-Tag and β-D-Fru-(2→1)-D-Tag. In vitro studies demonstrated the resistance of tagatose-based oligosaccharides to intestinal digestion and their prebiotic properties, providing insights into their structure-function relationship. β-D-Fru-(2→1)-D-Tag was the most resistant structure to small-intestinal digestion after three hours (99.8% remained unaltered). This disaccharide and the commercial FOS clustered in similar branches, indicating comparable modulatory properties on human fecal microbiota, and exerted a higher bifidogenic effect than unmodified tagatose. The bioconversion of selected rare sugars into β-fructosylated species with a higher degree of polymerization emerges as an efficient strategy to enhance the bioavailability of these carbohydrates and promote their interaction with the gut microbiota. These findings open up new opportunities for tailoring natural rare sugars, like D-tagatose and L-sorbose, to produce novel biosynthesized carbohydrates with functional and structural properties desirable for use as emerging prebiotics and low-calorie sweeteners.