How old is the PC with the ram you want to use. If it's about the same age, you MIGHT be lucky.
For starters I would take the ram out of the doner PC, and have a look at it. It should have a label on it, giving details about make/model, and more importantly, it's spec.
The same should be true for the ram in the PC you want to put it in.
Have a look.
You might find that the ram in one PC looks radically different from the ram in the other, in which case you lucked out. If it looks the same though.....
Read the labels, and post what they say back here. Someone whould be able to give sutable advice.