Low energy density fuels, like producer gas from biomass gasification, can be profitably used in compression ignition (CI) engines by means of a proper combustion strategy, such as the dual-fuel mode. Experimental investigations have proven the environmental benefits of the use of producer gas in terms of green-house gas emissions but critical issues related to their use in CI engines have been also highlighted. In particular, under specific operating conditions, the performance and the emissions of the engine might be derated reducing the attractiveness of the technology. In this work a new data-driven emission optimization strategy for a micro-cogeneration system based on an open-top biomass gasification unit coupled with a CI engine running in dual-fuel mode (producer gas/diesel) is presented and discussed. The main purpose of the work is to provide an appropriate tool to address one of the typical problems of dual-fuel systems, namely the nitrogen oxides (NOx) and carbon monoxide (CO) emission trade-off, by calculating the optimal diesel substitution rate (DSR) at a certain required power load. The methodology baseline is the experimental characterization and parametric modeling of the system in terms of NOx, CO, and electrical efficiency (ηe). Then a trade-off objective function (TOF) is defined. The novelties of the proposed approach stands in the building of an ad-hoc designed TOF so as to describe the problem with a single-objective optimization, and thus avoiding the computational and time complexity of a multi-objective optimization. Moreover, a second peculiar aspect is the introduction in the TOF of an internally dependent coefficient (namely the load factor Kl) able to take into account the effect of load and DSR on CO emissions: the adding of such a physical-related feature represents an effective enrichment of the minimization strategy, especially considering the nature of the optimization, which is purely data-driven. Finally, sequential quadratic programming (SQP) minimization of the TOF is carried out by means of the available MATLAB SQP libraries, and two optimization strategies – namely, CO-driven and efficiency-driven - are discussed. Results show (i) promising potentialities in identifying the best effective utilization range of dual-fuel combustion; (ii) high flexibility in the use of the optimization algorithm thanks to the definition of the TOF, which can be easily adapted to different objectives (e.g., NOx mitigation, maintenance of high electrical efficiencies, CO emission bounding) while maintaining external constraints; (iii) high robustness even in the extreme cases in which the imposition of a particular constraint (e.g., high electrical efficiency) is not compatible with the capabilities of the system.