Can anyone help me identify this component from an old rechargeable battery pack?
From its appearance, I'd say it's a diode.

It was probably there as a temperature sensor.  The charger would monitor the temperature, and stop charging if the battery got too hot.

Without any more information than you have, there's no way to really pick a replacement.

About all you can do it assume it is a standard silicon diode, and replace it with something standard.

A 1N4148 would be a good place to start.

It would surprise me if it needed any kind of precision.  You're not measuring the temperature, really.  You are looking for a drastic rise in temperature so as to prevent overcharging.

Since you say one end went to ground, I'd connect the replacement with the cathode towards ground - there should be a positive voltage on the terminal that goes to the charger, and the usual way to use a diode as a temperature sensor is to pass a small current through it and measure the forward voltage of the diode.

I would not recommend charging it without the temperature sensor.  The charger uses a fairly high charging current, and could damage your batteries.  The charger might even not work at all if the temperature sensor is missing.