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...