5 gallons is is fine. While probably on the small end of the "This will work" scale, the peppers will grow healthy and produce plenty of pods.
The plants tend to grow until they reach a limit in either root space, nutrients, or a combination of both. With proper fertilization, you can grow a...