I would say that 5cm is probably a bit much generally though it is not likely to turn anaerobic as it is still quite large grains.... this is more of a problem with eg. Sand. Are you aiming to have the substrate sloped from back to front? You can certainly have substrate is deep even more so... but you don't need it to be. I would say 3 cm is more than adequate. You can probably go down to 1.5 or 2cms right at the front.
Like Matt mentioned you don't need to worry about it becoming seriously anaerobic it's too granular for that to happen. How deep you use it really only depends on the design of your scape.
I'm using a similar Gucci substrate, ADA AS, and it must be going on 20cm deep at the back. Take a look at some of Takashi Amano's scaping videos he just pours is in as deep as he likes.
However, I wouldn't recommend a depth of less than 3cm at the front since it becomes very difficult to plant in otherwise.
Regardless, sediments are anaerobic by nature, aquatic plants will oxygenate the rhizosphere themselves via their roots so it becomes more conducive to supporting healthy growth; it's not uncommon for plants to modify their environment. And any hydrogen sulphide gas released is quickly oxidised to harmless sulphates in the presence of oxygen. And a healthy oxidised microzone also helps keep the growing environment and, in turn, the tank, heathy.