Pectin structures have received increasing attention as emergent prebiotics due to their capacity to promote beneficial intestinal bacteria. Yet the collective activity of gut bacterial communities to cooperatively metabolize structural variants of this substrate remains largely unknown. Herein, the characterization of a pectin methylesterase, BpeM, from Bifidobacterium longum subsp. longum, is reported. The purified enzyme was able to remove methyl groups from highly methoxylated apple pectin, and the mathematical modelling of its activity enabled to tightly control the reaction conditions to achieve predefined final degrees of methyl-esterification in the resultant pectin. Demethylated pectin, generated by BpeM, exhibited differential fermentation patterns by gut microbial communities in invitro mixed faecal cultures, promoting a stronger increase of bacterial genera associated with beneficial effects including Lactobacillus, Bifidobacterium and Collinsella. Our findings demonstrate that controlled pectin demethylation by the action of a B. longum esterase selectively modifies its prebiotic fermentation pattern, producing substrates that promote targeted bacterial groups more efficiently. This opens new possibilities to exploit biotechnological applications of enzymes from gut commensals to programme prebiotic properties.