If you can find the matching CPU it should work. Re-install the heat sink properly (of course) and it's a good idea to wipe off the old thermal paste and re-apply before installing the cooler.
What CPU is this? It must be a modern AMD chip or an older Intel chip from before they moved the pins to the motherboard socket. Getting the exact match should guarantee compatibility with the motherboard but something similar might work depending on the board. If you go to the board maker's site there should be a CPU Compatibility list you can check against.
Go to your motherboard makers website and look up compatible cpu types. You might as well get the quickest chip you can that will work on your motherboard if its not much more $$$ than the one you were using.