I just came across this issue in an IRS audit for a new client of mine. Their former accountant was using this strategy (that you outline above). They are disallowing this as an expense under this situation. The IRS has taken the position that in fact you are just paying yourself and will not allow this type of related transaction.
However if it is structured as follows it is acceptable. The building should be held in a limited partnership with an LLC as the general partner and you and someone else as the limited partners. You convert your Schedule C (sole proprietorship) to any other form of activity LLC, S-corp, etc. Then you have the newly created entity LLC, S-corp etc. rent the building from the Limited partnership addressed above. THis is the way to audit proof the transaction that you want to benefit from.