If I understand what you have in mind, the light will not be in the room pictured but on the other side of this wall. Only the switch will be on this side.
The outlet box in the first picture (holding the wires) cannot be buried in the wall without access. If you use that box, it need to have a plate on the room side, even if that plate is a blank.

That outlet box already in the wall is more likely one like this

In most buildings wired in the past 50 years, the wires are non-metalic (NM), that is, the outside insulation is a plastic sheath, rather than a metal cover.

These wires are held in by a clamp. The box you picture with the knockouts is used with metal covered wires or wires inside metal conduit (although there is an adapter clamp available for NM cables).
You will need to install a box on the outer wall to attach the light fixture to. You need to make sure that box is watertight once the fixture is installed.
You probably are better off loosening the clamps that hold the wire in, removing the existing box, rerouting the wire from that box to the new box for the fixture and running another set of wires from the switch box to the new box. Remember that no wire connections can be outside a box or inaccessible.
Unless you want the switch exactly where you have pictured it, you could use the old box for the switch and place the new box slightly higher or to the side of the old box, but on the same side of the stud. When you loosen the wire clamp, you may be able to reach the much smaller knockout which can usually be removed with a screwdriver. Then you can leave the power wire in the old box and run a new cable for the switched wire and the neutral and ground from the old box to the new box.
You must make sure that all wires you are approaching are not live. After opening the breaker, test every wire with a non-contact tester, such as this one.
