Read this spoiler free chapter of the guide to The Last of Us 2 to learn how to get the fuel needed to open the gate.
First fuel location - Courthouse
Get on your horse and head to the other open gate. You get to a big, open space. You now have a lot of freedom in exploration. You can visit a lot of buildings - we described this in other chapters of TLoU2 guide. Our focus is to get fuel - go to the building shown on the map above. Find a ladder on the right side of the building - climb it to the top.
Go to the window and open it with Dina's help - you will encounter a clicker. Kill him quietly and start clearing the area. You can use a stealth kill to eliminate, e.g. one more clicker and two runners. Try to eliminate them in this way - you are about to face more enemies and it is a shame to waste your health and ammunition.
After killing the enemies, go to the door and open it with Dina's help. Below you will find stunt bombs, which are useful when you are attacked by a large group of enemies.
Go to the board and read it. In the next room, you will find a safe (86-07-22). You should also remove the machete from the dead guard - the weapon will make the fight much easier.
Now go up to the elevator shaft and slide down the line. You are in for an intense battle with mutants. Use firearms on clickers and the machete on runners. There are a lot of enemies so be careful and help yourself with, for example, grenades and Molotov cocktails. Go to the fuel tank - it turns out to be empty. However, you will take the canister. Now go to the chain next to the gate and pull it to open the garage door.
Second fuel location - Ration Distribution Center
Go to the next location where you can probably find some fuel. Enter the downtown area, pass the signs warning of flammable materials, and turn left.
Walk a bit until you reach the gate, hold it for Dina to reach the other side. There is a runner nearby - the area is covered with tall grass. This is a good opportunity to test the mechanic of hiding in the grass - you are much less visible in it. This is a good way to sneak up on enemies and kill them quietly.
After the fight, jump to the other side of the fence - you will run into a large group of mutants. Again, you can use the tall grass to crawl around and perform stealth kills on the targets.
After the fight, jump on the chest and take the stairs up. Go inside through the window and you will end up in the synagogue. Go through the dilapidated grates to the storage area, then move the trolley to the other side.
Eventually, you will reach the tank and fill the container with fuel. Now move the trolley to the center of the synagogue so you can jump to the upper floor. Use the elevator to swing and jump to the other side. From here, jump out the window to get out of the building.
Since you have fuel, you can head to the closed gate or take some time to explore other buildings. You won't return here, so if you care about seeing everything in the game, go to the other chapters of our TLoU2 guide to learn how to, e.g. find a shotgun in the bank.