Just for legality's sake, be careful what you describe here. This forum is completely legit, and while I'm not arguing or judging one way or another, what you describe sounds eerily akin to downloading commercial software, then replacing some kind of registration file or support file with a hacked version to bypass registration or to artificially extend a trial period.
If this doesn't pertain to you at all, then I apologize in advance -- I'm simply stating the rules for a new forum member so they don't have unrealistic expectations of the kind of help they can receive here.
Don't shoot the messenger -- just saying that this forum doesn't discuss non-legitimate things... just for future reference!
At any rate, to answer your question, it seems that you are performing the correct procedure, but if the file is not "replacing" the other file, then there is one and only one answer to that: the files do not have identical names.
If you wish to replace a file with another file, an extremely simple way of doing so is to highlight the file you want to replace and press enter... this will change the name of the file to being editable (it will be highlighted), at which point you can copy that file's name (command-c or Edit > Copy from the menu). Then, perform the same procedure on the file you want to use to REPLACE the original file, and paste the copied name as the file's new name.
Then, drag the file to where it's supposed to be and you will be prompted to replace the existing file. If you are not prompted with this dialog, then the names of the files do not exactly match. Perhaps you've a single character out of order, or the file's extensions are different and you have the Finder set to hide file extensions (such that you can't see the file's extension and therefore don't know if they have the same extension).
Try that and see if it works... if not, report back and we'll try something else.