OK, we need to see a picture of the piping. If you are lucky, the line for the toilet could be such that all you need to do is cut a portion of the horizontal line out or add a section of horizontal line running to the main with minimal angles. Your best approach is to keep the vertical pipe to the toilet location totally vertical. When you say, "5 inches up", I assume you don't mean raising the toilet 5 inches, but moving the toilet "up" as looking at the toilet in a plan view, correct?
The construction issue you will likely run into is that the floor joists are at a set location, and you will very likely want the new toilet location to be such that one will interfere with the piping. That will mean you will need to perform some carpentry to "box out" the toilet to allow the piping to be properly ran. Again, a picture and a drawing of the new toilet location with joist shown will be needed to provide an answer to you question.