Yes, buildings insurance is designed to cover damage to your property, such as that caused by a burst pipe from an upstairs flat.
If you discover a leak, isolate and contain the water as much as possible and contact the freeholder or their managing agent as a matter of urgency.
Ensure you document and photograph (with timestamps) the damage caused and proof, if possible, about the source, and keep receipts for any claims.
Damage to the structure of the building will be covered by the buildings insurance while damage or loss of personal contents will be covered by your own home contents insurance policy.
Generally, leaseholders are responsible for the pipes that only serve their own property, even if they are found outside.
In which case, if a neighbour has neglected to maintain the pipes that serve their property and a leak causes damage to your home and/or contents, your neighbour is liable.
A ’trace-and-access’ clause in buildings insurance covers the costs of investigating the source of damage, including escape of water, and making sure it can be reached for repairs.
Depending on the wording of your lease agreement, the excess may be shared among all the leaseholders affected or a single individual. It’s always worth checking what you’re liable for.