In the future, the easiest way to find out where a wire is supposed to go is to trace it to it's other end and see where it's connected.
If it goes into a wiring bundle, track the bundle until you see a similar colored wire coming out or hitting a connector and do a continuity check to see if it's the right one. If it hits a connector, you can usually check schematics or pinout sites to find out what it does, then go connect the loose end appropriately.
Since you solved your problem, you probably already know this, but this may help some less experienced or knowledgeable people who come up with similar problems.