It may also be possible (but not always) to just replace the palette while the file is in Indexed Color mode.
Or... depending on what colors the original gradient is made up of, you can sometimes extract a decent greyscale by looking at each of the R, G, or B channels in isolation. Open your Channels palette for that.