Energy consumption in residential, commercial and industrial buildings is one of the major contributors to global warming. Due to the increase in the latter, and growing global energy crisis, more attention is being paid to renewable energy resources (RES). The use of innovative concepts in existing buildings is gaining popularity to provide reduction in energy requirements for electricity, heating and cooling. In this paper, an electricity, heating and cooling cooperation mechanism among neighboring buildings with RES is proposed. It relies on adjusting the RES tariff with a mutual agreement between the neighboring buildings, with an aim to minimize the operational costs. For this purpose, a mathematical model is developed for joint energy cooperation, where surplus energy in one of the buildings is shared with others, thereby reducing dependency on the grid. The optimization structure of the environment friendly energy cooperation is nonlinear, which is linearized using the McCormick envelopes. A scenario for the city of Islamabad, Pakistan, is considered by utilizing its environmental data obtained from public domain websites. The simulation results show more than twenty percent energy cost savings with the proposed cooperation model.