The problem with a battery is there’s no known technology that can accept that much energy that quickly. Five gigajoules is a lot of energy, it would be a massive battery and would have to accept a full charge in a tiny fraction of a second.
It might be possible with a capacitor array. At a hundred megavolts a capacitor array would not have to be terribly large to store five gigajoules. The initial problem is insulation. With that kind of voltage everything would have to be housed in a vacuum since any exposure or contact could provide a path to ground. Then there’s the amperage the capacitor has to handle in charging. A hundred thousand Amps over any conventional conductor is going to vaporize it. Maybe super conductors could be employed.
Say you get past those challenges and you have a capacitor array storing charge at a hundred megavolts. You have to convert it to useable voltage somehow. You need a step down converter that can handle voltage that high. Now you have a whole new set of electrical engineering obstacles.
It might be feasible without sci-fi technology, but then would it be worth the development and deployment cost.