This gate is rubbing up against the wall of this house, and the locking mechanism is on the incorrect side of the post where the lock is and now the gate will not correctly open. I think the problem is just that the gate is sagging. How would you go about a cheap fix? I think I just need something on the bottom of the gate to slightly raise it. It looks like there is already something there that was supposed to serve this purpose, but it is not raising it enough. I have circled that piece in red. Perhaps I just need one that is longer, but i don't know what the name of that piece is. Can anyone help me?
I would purchase a kit that has a steel wire and turnbuckle setup attach to the hinge side top left and the bottom right, some of the kits have turnbuckle the wire rope clamps and brackets to screw into the frame work for under 20$. These kits will allow you to tension the gate and remove the sag. You will need to adjust the latch but without the sag the gate would swing normally. Link not working right but Google ace gate anti sag kit 13.99$
You need a turnbuckle. Aquire one roughly the length of the gate's width, and install it from upper left to lower right on frame members. Tighten to lift. If necessary, extend it with some lightweight chain, stiff wire or cable.
I see that there's a notch in the gate that should correspond to the brick ledge. This fix should bring that back into position, eliminating the rubbing issue.
The upstairs doors in my house all got to sagging like that. The hinges looked fine but in fact had come loose. The wood of the door jamb was soft and use had wiggled the screws loose. For sure your jamb is soft too. I bet the same has happened with your gate. In fact it looks as though the top hinge has either been replaced or moved - there are two holes from the old hinge position visible in the photo. Maybe whoever did that fix is the one who hung it back with the latch on the wrong side.
Here is an easy thing to try. Prop up the far end of the gate so you don't have the whole weight of it on just one hinge when you unscrew the other. Unscrew one of the hinges from the support post, pack a bunch of long splinters or toothpicks in the screw holes to make it snug, then screw it back on. Repeat with other hinge. If that works, that's your answer.
The second time I had to do that in the house I filled the holes with these hole anchors:
source the idea being the anchor would not compact and loosen the way the soft jamb wood did. So far so good.