Hi Erik,
What is the length of the #4 cable, and, it is it in conduit?
How many current-carrying conductors are being run together with this #4 cable? Is the ambient temperature elevated, at times?
NEC is very conservative on Ampacities, and most other things. If this installation is being inspected, an inspector may flag it.
If this cable is short, and in free air, you are probably good.
As you well know, sometimes one can run a short #4 cable, to the DC breaker, and make the transition to a larger cable at the other side of this breaker. This might require adding a breaker box, etc ...
I am NOT a Code Expert. FWIW, Good Luck, Erik, nice to see you here. Take care, Vic