No. There isn't any hidden option for 5x5 in the JS API. Also, AGOL doesn't allow for 5x5 classes...I'm curious where you saw that.
Can you describe your use case for the 5x5? This would result in 25 unique colors, which can be difficult to interpret. 4x4 already pushes the limit in that sense. Is it a diverging scenario where you want to have two neutral colors and two diverging color ramps? That would be an interesting scenario we can investigate for an enhancement...
Thanks for your reply. I thought I saw a 5X5 some time but then rechecking again, it was 4X4, sorry about that. But my use is that we needed a 5X5 matrix (it is a requirement). Having them linearly with 25 such colors is not practical. Please consider this as enhancement for future.