"L" is the terminal to which the "light" wire connects to. This is the same wire that feeds the "L" terminal on all other gauges. It has 12 volts on it when the NAV/ANC switch is in the NAV position. "G" is indeed ground. The wire on the "S" terminal feeds the "S" (sender) terminal on the gauge. What you have in your hand in the first photo is not a switch. It is the trim sender. As the lever moves, the resistance (ohms) between the "S" terminal and "G" terminal should change. Wiring is likely not the issue (although it could be) but rather the sender itself. Here is the test. Disconnect the wire from the "S" terminal on the sender. With the key in the RUN position, touch that wire to ground (unpainted bolt or surface on the engine). The gauge should immediately jump up. If it doesn't, verify there is 12 volts on the "I" terminal at the gauge. If not, fix it. It should get that power from any other gauge. Also verify that the "G" terminal has a good ground (also from any other gauge).
If the gauge has power and ground and the test for the "S" wire at the sender pegged the gauge, then the sender is bad. Using an ohm meter to verify resistance changes as you move the lever will prove the sender is good or not.