Pin 1 has the plastic stripe on corner of connector... closest to the bottom right and has what looks to be a yellow wire.
Pin 2 has first red wire
Pin 3 has second red wire
Pin 4 has yellow wire... or yellow with black stripe?
Pin 5 is middle... empty.
Pin 6 is green
Pin 7 should be yellow with black stripe
Pin 8 ... I forgot
Pin 9 ... I forgot
In the second photo - pin numbers are like this:
9 - 6 - 3
8 - 5 - 2
7 - 4 - 1
Can also find pinout at Molex website.
See below for excerpt which shows wire entry side of both 6-pin and 9-pin plugs.
Make sure the wire color matches *at both ends*.
... also, never assume that was done before was done correctly.