I will write from the perspective of mathematics. This sort of issue comes up often and can often be tricky. One thing is clear: you must cite the prior work. Now you write:
If I cite the original work it will seem like I simply took it from there,
I don't follow. First of all, you can say "I proved X independently, before I became aware of the work of [CITE]." Whether you will get any credit for this is another matter, but you can certainly say it.
But moreover, assuming the literature you found is old enough so that your work really was done afterwards and not at roughly the same time [in mathematics this is usually the case with published literature, since the publication process is rather slow], the only point of mentioning the result is if your take on it is not completely subsumed by the original. If there is some novelty in your approach to the result, it is fine to include result...and your new derivation of it. (Comment on @Massimo Ortolano's answer: in mathematics, appendices rarely contain omitted proofs from the body of the article.)
Let me reiterate that it often happens that after you've written a math paper you find out that there's some amount of overlap with past work. You don't necessarily have to scrap the whole thing or even excise all parts of your paper that overlap with past work -- in some cases, doing this would make your paper less readable with no other benefit. However, you should make a strong effort to do justice to the previous work. (It does not feel good to have a finished paper in hand and learn that X% of it is not new. If I'm being really honest, I often do feel a momentary temptation not to include an "obscure" citation that could lower the perceived value of my work. I've never given into it though, and at this point I recognize it as pure ephemeral evil and it passes through me quickly.) The right way to look at it is this: if no one cares about this part of your article, then no one cares and you have nothing to gain by omitting the citation. If they do care, then the readers who care / know the most will know about the other work -- either immediately or eventually -- and you place yourself in a much better situation by calling attention to the overlap yourself.