The energy balance of lean-burn turbocharged engines using biogas as fuel is reported. Digestion data were obtained from the wastewater treatment plant (WWTP) of the city of Burgos (Spain), operating with a thermal hydrolysis unit for sludge pre-treatment. Operational performance of the plant was studied by considering the treatment of sludge as a comparative base for analyzing global plant performance if co-digestion is implemented for increasing biogas production. The calculation methodology was based on equations derived from the engine efficiency parameters provided by the manufacturer. Results from real data engine performance when evaluated in isolation as a unique control volume, reported an electrical efficiency of 38.2% and a thermal efficiency of 49.8% leading to a global efficiency of 88% at the operating point. The gross electrical power generated amounted to 1039 kW, which translates into 9102 MWh/year, with an economic value of 837,384 €/year which was completely consumed at the plant. It also represents 55.1% of self-consumption regarding the total electricity demand of the plant. The analysis of the system considering the use of the total installed capacity by adding a co-substrate, such as cheese whey or microalgae, reveals that total electrical self-consumption is attained when the co-substrate is directly fed into the digester (cheese whey case), obtaining 16,517 MWh/year equivalent to 1,519,160 €/year. The application of thermal hydrolysis as pre-treatment to the co-substrate (microalgae case study) leads to lower electricity production, but still attains a better performance than a mono-digestion baseline scenario.