Uber:
There's nothing that makes Ni good at math by itself. Ni strengthens pattern perception, though, and I am thinking that such recognition would help while studying or learning math, especially if one is interested in it (that is key). I find that once I grasp the ineffable "essence" of whatever it is that I'm interested in, it just sticks, permanently, and floats up to my mind when it's time to utilize the info. Ti might have a hand in that, too.
I've never had that interest in math, myself, (mostly because I find that most exercises exist in a vacuum with no real purpose behind them besides the practice -- which isn't a valid excuse, of course) but I do get by -- it's just not an active pursuit for me at this time, and never has been. But who knows what the future will bring.