Just did this same thing on my 2008 Impreza. I read that wiring diagram you attached and the color code, came up with this, and it worked! Thanks.Attached.
There's two connectors at the driver side window switch, D7, which has sixteen pins, and D102, which has three. Your photo is probably is D7.
At the bottom of the first page, there's a diagram of D7 showing the location of each pin number. This is looking at the working face of the connector, not the back where the wires go in. Each pin is numbered, and those numbers are also shown in the wiring diagram. In the wiring diagrams, the pins associated with D7 are identified by "A", e.g., A16 and A13, which are pins 16 and 13, and which go to D3 at the window motor.
Each wire is identified by a single, or two, colors (a main body and a stripe). Hopefully, no colors are repeated. In the wiring diagram, the wire colors are indicated next to the pin number. Additional connections to D7 are also found on the following pages. I count 9 wires in your photo, and 9 connections at D7 in the wiring diagram.
Here's the color code:
View attachment 495355
Let us know how it goes . . .