I found that you either need to be super precise (I found that I was able to beat her within the timeframe by using Reimu-Needle), or you can cheese it with the Cheat Engine the game lets you use.
I’ve found I’m consistently able to beat her with all shot types if I lose all my lives in Stage 1 to get the Full Power item, and then use the invincibility cheat to make sure I can hit her without missing any bullets.
Reimu-Needle is probably your best bet for damage, and I was able to beat her without the cheat engine with it, the fight’s just a bit precise without the cheat.