Stamp plane UV onto a mesh
The distortion you are seeing is the result of the mesh and the UV maps not sharing the same proportions. Here is one method for achieving your desired effect, but it assumes that your texture is only for the wall, and that the four vertices of the window don't have to be in a specific place on the texture.


In Edit Mode, press Shift+D with your mesh selected to duplicate it.
Move the window to the desired position.
With the duplicate selected, press U to unwrap it.
With both meshes selected so you can see them unwrapped, position the newly unwrapped mesh above the old one. This can be achieved in a number of ways, but one ways is as follows:


Select old wall's bottom left vertex on the UV map, and move the cursor to the selection.
Using Vertex Snap: Closest, position the new wall on the UV map such its bottom left vertex aligns with the old wall's.
Set the pivot point to cursor, and scale the newly unwrapped wall until all of its vertices align with the old wall. Make sure you are always scaling the whole wall, including the window vertices.