I'm guessing you already have a 7 pin on the trailer?
It looks like you already have a flat 4 wired in and you ran a 5th wire to tie into the 7 pin?
If you're not too far along at this point It would probably be easier to make an adapter that plugs into your flat 4 and the 5th wire with a long enough set of wires so that you can just plug in the 7 pin on the tongue of the trailer and secure it there.
Edit, you could eventually make an adapter using something like this wired to your 7 pin that would normally mount on the tow rig. Notice the 5th wire is blue... for brakes!!
View attachment 344103