It should stay put when you pull it out of the transmission tail shaft, it only slides in the removable piece with the O-ring,{not sure what the technical name is for it}, It should slide back into the transmission by hand, DON'T use a hammer :!: Just some additional info for you if you need it..... That plastic gear meshes with output shaft, so the speedo will work. You can switch to a different color gear to get your speedo more accurate if it is reading too slow or fast. A local transmission shop could help you figure out which color to use, they usually just need the rear gear ratio.
Good luck!!!