Given the two engines in isolation (eg, not installed in a car or any other machine), and given that both engines are identical displacement and given that both engines produce identical amounts of power, then the 4-cylinder engine will use slightly less gasoline than the 6-cylinder engine because of increased frictional losses in the 6-cylinder. If you put the engines in a car, then all bets are off because of variables such as drag, vehicle weight, and gearing. If a 4-cylinder engine has to spin at 3,500 RPM at 70 mph, and a V8 only has to spin at 1,500 RPM at 70 mph, then the V8 can (but does not have to) get better mileage.
ZV