This is a video showing one method of doing it.
Basically, you get your Charizard to use Roar constantly, since Jirachi deals out close range attacks so it won't attack unless it's close to you. Press the A button when Jirachi is away from you, and when Jirachi is within one square distance, Roar again. Keep an eye on your PP, and use Max Elixirs to replenish.
Incidentally, here is the first part of the walkthrough for Wish Cave.
4th part (Jirachi Battle)
The video uses Charizard as well.