Use of electrically controlled fuel-injection as seen in modern marine smaller outboard engines like a HONDA or TOHATSU 40-HP or 50-HP is very common. But the metering of fuel into the engine intake air stream with an electrically controlled fuel injector does not inherently mean that the engine will adapt to radical changes in altitude.
Some modern engines include a barometric sensor and an intake air temperature sensor. This sensor data is provided to the engine management module (EMM) or engine control unit (ECU). The EMM or ECU may then use this data to alter the amount of fuel that will be dispensed so that the ratio of fuel and air remains in the desired proportions. That sort of sophistication in fuel-air mixing control is provided by the engine designers and incorporated into the EMM or ECU. It does not reside in the fuel-injectors themselves.
Generally as the elevation increases the air becomes less dense. Unless the engine uses an air intake boost method, such as supercharging or turbocharging, there is no way to increase the intake air volume to make up for the lower density. Note that in older carburetor two-stroke-power-cycle engines there is, actually, a pumping mechanism in the design that pushes air into the combustion chamber, so a classic two-stroke-power-cycle engine has some effect of boosted intake air pressure. But a four-stroke-power-cycle engine with the typical intake and exhaust valve arrangements does have any boost method.
Modern automobile engines use a Mass-Air-Flow sensor to determine the amount of air flowing into the engine. I am not aware if that technique is used on any small-horsepower marine outboard engine. See
https://en.wikipedia.org/wiki/Mass_flow_sensorI don't have an authoritative cite, but several boaters have commented that a mass-air-flow sensor is not permitted on a boat engine because of the heating element in the sensor.
A Manifold-Air-Pressure (MAP) sensor may be used. See
https://en.wikipedia.org/wiki/MAP_sensorIn general, the purpose of adjusting the amount of fuel to match the air density is to keep the fuel-air mixture at the proper ratio. This permits the engine to run smoothly, as otherwise with increasing altitude the fuel-air ratio may become too rich and result in poor engine run characteristics.
But maintaining the proper fuel-air mix ratio as the density of the air decreases does not preserve power output. With less fuel being burned in the combustion chamber, the engine will develop less power.