5 wires on the trailer side? does the trailer have electric brakes? sounds like at one time someone did some presidential engineering on the trailer side wires.
typical 5 pin would have white, yellow, green, brown and blue. 4 pin flat would have white, green, yellow, and brown.
flat or round plug on the trailer and whats on the tow vehicle? shouldnt take much to figure out what was done and what to wire based on needs.