It's easy enough to find out which is power, so connect power, usually +5V and then put a meter on the other pins one at a time and move an axis to see if it reads. For all wires connected to a common, look for a pin that will read as a short across more than 1 pin.