There doesn't seem to be an option to set the number of gridlines directly, and the number of tick marks is generally changed based on the axis interval.
I think you can adjust the number of your intervals to be consistent. Why do you find it difficult to coordinate intervals? For example, your secondary axis can be set to 7-35 and the interval is set to 7, you can try to see.
I did a simple test. This is the setting for the secondary axis.
Preview:
Best regards, Aniya