TL;DR
In principle, you cannot deduct a real estate capital loss from a capital gain realized on another property. Specific cases allow limited offsetting, particularly for properties acquired in successive portions and sold under the prescribed conditions, or shares in the same real estate company held by the same taxpayer.
The general rule excludes real estate capital losses
The gross capital loss realized on certain assets or rights is not taken into account.1
Two exceptions allow limited offsetting
When a property acquired in successive portions is sold by the same deed subject to publication or registration and between the same parties, the gross capital loss or losses, reduced by an allowance calculated under the same conditions and according to the same procedures as that provided for in the first four paragraphs of I, are offset against the gross capital gain or gains, adjusted, where applicable, by that allowance.1
The gross capital loss realized on the sale of shares in real estate companies is not taken into account. In the event of a block sale of all or part of the shares in the same real estate company held by a taxpayer, the gross capital gain or gross capital loss relating to each of those shares must be determined separately, according to the rules specific to it. In this same case, the gross capital loss or losses, reduced by the allowance for length of ownership calculated under the same conditions and according to the same procedures as that provided for in I, may be offset against the capital gain or gains realized on other shares in the same real estate company by the same taxpayer.2
The fact that the block sale of all or part of the shares in the same real estate company held by a taxpayer is made to different buyers does not prevent this mitigating measure from applying, provided all other conditions are met.2