What if there actually is a magic money tree? A fair and reasonable way to raise cash? Halloween may be a time of ghosts and legends, but for the sake of our public finances it’s time we stopped pretending this is a mythical entity.

There is a country that taxes British residents, and British companies, when they make money on selling commercial real estate, but doesn’t tax foreigners. That country is the UK. Closing the tax loophole around non-UK companies and commercial property sales would level the playing field for British businesses and at the same time help tackle the overheated housing market. It would also generate substantial revenue – enough to cover the entire public health budget for a year, for example.

Taxpayers should be asking why their government turns a blind eye to anyone who holds UK property in offshore companies

According to the British Property Federation there is about £871bn worth of commercial real estate in the UK – 10% of our nation’s net wealth. Not only is this hugely important in its own right, its value impacts on the price of land, and hence of new homes. About 20% of commercial real estate is sold each year – worth an eye-watering £115bn in 2015, according to Her Majesty’s Revenue and Customs.

When a seller is a UK individual or company, they are subject to UK corporation tax on their capital gains. Yet where the seller is foreign they are not. Approximately one-third of all UK commercial real estate – including most high value property – is held through offshore companies. Typically these companies are in tax havens, or structured so they pay no tax on the capital gain. Indeed, British taxpayers should be asking tough questions as to why their government turns a blind eye to anyone who holds UK property in offshore companies.

In 2015 the then chancellor George Osborne made a big deal of taking action against non-doms who avoided paying tax – ending permanent non-dom status and changing the rules on inheritance tax. He also introduced capital gains tax on residential property sales by non-doms – but crucially not commercial properties. This has created the world’s most obvious loophole where overseas individuals and companies can repurpose property as commercial to avoid it. Closing this loophole could be very lucrative – estimates suggest it would raise between £5bn and £8bn per year.

Those worried that this would put Britain itself at a disadvantage against our competitors can be reassured: the United States taxes foreigners making a capital gain on US real estate, as do Spain, France, Germany, Italy, Canada and Australia. The Organisation for Economic Co-operation and Development rules explicitly allow nations to tax foreign-owned companies on the sale of their real estate. Yet successive UK governments have quietly let this injustice continue.

Last week I tabled legislation to try to tackle this – but the government didn’t want to know. Treasury minister Mel Stride simply said it would be too “complex” to implement. With such sums at stake, our public services cannot afford for us to leave this in the “complicated” box any longer: the dividends could make a real contribution to our cash-starved schools and hospitals. In addition, it would improve the fairness of our tax system and help take some of the heat out of the UK’s inflamed property market.

We have another opportunity this coming week to finish what Osborne started. Parliament can act by supporting my amendment to the finance bill at its report stage on Tuesday 31 October. With cross-party support already building for it, this Halloween it’s time to give those overseas companies not paying their taxes a real nightmare.

• Stella Creasy is the Labour and Co-operative MP for Walthamstow