Not sure about the plug compatibility but in general the wires needed are the same. Basically there is power and ground usually expects 5V and 0V reference on the red and black respectively. Then usually there is a yellow and green pair usually these are for the compass and is for connecting to I2C bus which has SDA (data) line and SCL (clock) line and basically allows communication between the fc and the magnometer in this case (could be using I2C bus for other peripherals as well it is a common choice for a simple data bus that lots of micro devices can share their data on or read data from). The gps generally has a dedicated direct UART so has two wires as well usually orange and white or brown and white, one is RX and the other is TX.
So long as you don't reverse the black and red or basically reverse polarity the power you generally won't burn anything up. So long as the signal lines are all 5V tolerant and you are at most sending 5V signals into them you won't burn them out even if the wrong signal is going to the wrong place.