BackgroundThe lithospheric microbiome plays a vital role in global biogeochemical cycling, yet their mutual modulation mechanisms remain largely uncharted. Petroleum reservoirs are important lithosphere ecosystems that provide desirable resources for understanding microbial roles in element cycling. However, the strategy and mechanism of modulating indigenous microbial communities for the optimization of community structures and functions are underexplored, despite its significance in energy recovery and environmental remediation.ResultsHere we proposed a novel selective stimulation of indigenous functional microbes by driving nitrogen and sulfur cycling in petroleum reservoirs using injections of an exogenous heterocycle-degrading strain ofPseudomonas. We defined such bacteria capable of removing and releasing organically bound sulfur and nitrogen from heterocycles as “bioredox triggers”. High-throughput 16S rRNA amplicon sequencing, metagenomic, and gene transcription-level analyses of extensive production water and sandstone core samples spanning the whole oil production process clarified the microbiome dynamics following the intervention. These efforts demonstrated the feasibility ofin situN/S element release and electron acceptor generation during heterocycle degradation, shifting microbiome structures and functions and increasing phylogenetic diversity and genera engaged in sulfur and nitrogen cycling, such asDesulfovibrio,Shewanella, andSulfurospirillum. The metabolic potentials of sulfur- and nitrogen-cycling processes, particularly dissimilatory sulfate reduction and dissimilatory nitrate reduction, were elevated in reservoir microbiomes. The relative expression of genes involved in sulfate reduction (dsrA,dsrB) and nitrate reduction (napA) was upregulated by 85, 28, and 22 folds, respectively. Field trials showed significant improvements in oil properties, with a decline in asphaltenes and aromatics, hetero-element contents, and viscosity, hence facilitating the effective exploitation of heavy oil.ConclusionsThe interactions between microbiomes and element cycling elucidated in this study will contribute to a better understanding of microbial metabolic involvement in, and response to, biogeochemical processes in the lithosphere. The presented findings demonstrated the immense potential of our microbial modulation strategy for green and enhanced heavy oil recovery.Video AbstractGraphical AbstractSupplementary InformationThe online version contains supplementary material available at 10.1186/s40168-023-01553-7.