There is a concept known as "private inurement" which the IRS is really strong on. Once you deed or give any asset to a non-profit, then that entity owns it. Should something happen to the entity, the assets are expected to be given to another non-profit. Such assets are not to benefit individuals. You run grave risk by getting personal benefit from an asset that would belong to a non-profit. You would be well advised to consult with an attorney familiar with federal and state tax matters, as well as a good CPA familiar with non-profit reporting requirements.
LEGAL DISCLAIMER: Please note that this comment does not constitute legal advice nor has an attorney-client relationship been created.The law may vary depending on the state in which you reside or the jurisdiction where the activity took place. This comment is intended only to give some direction in which to seek further guidance. If you think my post was helpful, please check the thumbs up tab located below.
The previous response is correct. The question itself suggests you need to read up on this issue, as well. When you state - "your investment" and that you are the "owner" of a organization that is a nonprofit this is not a true statement. If the school is recognized as a public charity that you cannot own it. You may be the founder, you may even have special rights written into your bylaws but you are not the owner. Also, once you gift something to the organization it is no longer your investment.
In addition, if you wanted to give the property with the mortgage you may run into other tax issues. It is possible that you could lease the property to the nonprofit or a portion of it and possibly get a property tax exemption but this will depend on the local real estate regulations.
I strongly suggest you consult and attorney on this matter prior to doling anything else.