The second connector pin from the bottom is connected to what's almost certainly a ground pour, and this is in line with the through hole labels together with your diagram. This is your black wire.
I would bet money on the rest of the labels (and your diagram) being correct too, so red wire goes to middle connector pin.
If you're fairly certain that blue is in its correct location then we're done: green goes to bottom pin. If you are not, we can take a closer look.
From the top down, that would be
Blue
X
Red
Black
Green