Two DIY methods that you can try but have be careful with:
1. Place the motor can in a vise or clamp with the gear facing upwards. Take two flat blade screwdrivers of roughly equal size and place on either side of the vise with the blades up against the shaft and pry downwards on the screwdriver handles with equal pressure to try and lift the gear up.
2. Place the motor can in a vise or clamp with the gear facing upwards and, if you have a small torch, like a plumber's torch, heat the gear until expands enough to remove it from the shaft.
No guarantees, but either method is potentially capable of working. I always try the heat method first and sometimes try #1 after the gear has been heated up.