I may be way off track, but it looks as if the top pic is a hand brake cable. That square end goes into the drum brake mechanism.
The bottom pic is the rear brake line (hydraulic). You need to plug that brake line into the female threaded brake line on your chassis. Should be on the passenger side of the tailshaft just in front of the diff housing.