* Federal budget hikes capital gains tax on the rich

* Says Canada will meet its fiscal anchors

* To go ahead with a planned digital services tax

(Rewrites with details of budget)

OTTAWA, April 16 (Reuters) - Canada on Tuesday revealed a new tax on wealthy individuals that will bring in billions of dollars over the next five years to help fund housing programs designed to win over a disgruntled voter base.

In its annual federal budget, the Liberal government of Prime Minister Justin Trudeau also said that despite the increase in spending the budget deficit for 2023/24 would remain stable before gradually falling.

The government had already outlined its housing plans in the weeks running up to the budget and the main new element was an increase in the capital gains tax.

"The wealthy, who tend to earn relatively more income from capital gains, disproportionately benefit compared to the middle class," said Finance Minister Chrystia Freeland, adding the new measure would only affect 0.13% on the population.

Under the new measure, people realising capital tax gains of more than C$250,000 will pay tax on the excess at a rate of 66.7%, up from 50% at present. Similarly, all capital gains realised by companies and trusts will be taxed at 66.7%.

The additional tax will bump up government revenues by close to C$20 billion over the next five years and help in shrinking the government's fiscal deficit to C$20 billion by 2028-29, or half of what it was last year, the document said.

Since the start of April, the government has promised close to C$42 billion primarily to tackle a housing crisis, which, in part, has hurt Trudeau politically.

The next election is due by end-October 2025 and polls show the Liberals will lose badly to the official opposition Conservatives, who are promiding to slash spending and eliminate the deficit.

A higher share of revenues from the expansion of taxes will also help the government in meeting its fiscal anchors, said Robert Asselin, senior vice president of policy at Business Council of Canada, but criticized the tax on the wealthy.

"Wealthy people always have a choice to invest here or somewhere," he said, adding that the increase in the tax would chase capital away from the country at a time when it is desperately needed.

Freeland said the budget would ensure the government kept to the three main fiscal anchors it laid out last November.

These were to cap the fiscal deficit at C$40.1 billion ($29.13 billion) in the 2023-24 fiscal year, lower debt as a share of GDP for 2024-25 fiscal year and keep the ratio declining thereafter, and keep the deficit from exceeding 1% of GDP from 2026-27.

The new tax measure comes at a time when the government's spending shows signs of a permanent increase beyond the pandemic blip which distorted its fiscal goalposts.

Its overall expenses has also increased to over 17% of GDP in 2023-24 and is projected to stay around this level from what was projected before the pandemic.

"It's a permanent shift in spending... not related to the pandemic anymore," said Randall Bartlett, senior director of Canadian Economics with Desjardins Group.

Since the economic outlook has not improved, it has to increase taxes to pay for that spending, he added.

The budget also says Canada will go ahead with a planned digital services tax, which Washington opposes.

The budget also promised to introduce a framework legislation for open banking which would offer a secure way to transfer the financial data of users to approved third parties. It also promised a flurry of measures to unlock government lands across the country for housing. ($1 = 1.3820 Canadian dollars) (Reporting by Promit Mukherjee, David Ljunggren and Fergal Smith)