Walt, It might help you understand how to hook these up, if you have a better understand how a DPDT relay works. So here goes my attempt: Terminals 7 & 8 are the leads to a solenoid (electro magnetic coil), When the coil is energized the normally open (NO) contact gets closed, and the normally closed (NC) contact opens.
Based on your picture above terminals 7 & 8 are for energizing the coil. They are not polarized so one gets 12 Volts DC + and the other needs to be tied to the insulated rail on your track.
Terminals 5 and 6 are the power source voltage for your accessory light, could be AC or DC. If it's a typical 3 rail accessory like a green/red block signal then whatever the signal instructions call for should be wired to one of these posts. Typically 12 to 14 VAC is what's required.
Terminals 1 & 2 are probably NC, Normally Closed, if your powering a Green / Red Block signal the Green wire goes to the NC contact.
Terminals 3 & 4 are probably NO, Normally Open, the Red signal light wire goes here.
Keep in mind DPDT relay means Double Pole, Double Throw, the DP - Double pole part refers to having two INDEPENDENT sets of contacts. Terminal 5 distributes power to, 3 and 1, and has nothing to do with Terminal 4, which is controlling and distributing power to contacts 2 and 4.
If you have a small DC train transformer, like an HO set it to 12 volts, hook the positive side to either terminal 7 or 8 and the other side or ground side of the DC transformer to your U post, or outside rails... If you don't have this type transformer, you can use a wall wart 12 volt transformer, or as GRJ noted you'll need a diode like an IN4001 and a capacitor to convert the AC to suitable DC power.
If all this is beyond your technical abilities, reach out to me via my email, and I can provide you with a 12 volt AC relay...
Hope this makes it clearer and not more confusing.
Chris A