Unfortunately, you cannot do what you are planning on doing. Unless, the second floor toilet is vented separately from the stack, which it won't be.
You will have to run a separate drain line from the third floor toilet into the basement. Or, at least below the second floor toilet. But, really you need a plumber to come and look because we cannot see how the plumbing is run.