By Jeffrey Jones

CALGARY, Alberta (Reuters) - A hotly contested by-election in Canada's oil capital is proving troublesome for Prime Minister Stephen Harper's government as other parties chip away at support in a region his Conservatives have long taken for granted.

The result in the Calgary Centre voting district will not alter the balance of power in Ottawa, where the government has a comfortable majority. But it is highlighting how views in urban Alberta are diversifying as more people from across the country relocate to take advantage of a robust economy.

A loss in Monday's vote could force the Harper Conservatives to rethink strategy in the next federal election in 2015 after years of focusing efforts on other parts of Canada where results have been far less certain.

The campaign, where the Conservatives and Liberals are running first and second, is the highest-profile referendum yet of the Harper government's policies since it won its majority in 2011, thanks in part to taking every seat in Alberta but one.

A victory by Conservative candidate Joan Crockatt would show the Liberals and New Democrats, which are the official opposition, can not fight the Conservatives and each other, said David Taras, political scientist at Mount Royal University.

"But if the Liberal wins, it's going to break the psychological sonic barrier in Calgary. A Liberal hasn't won here in 45 years and it would give the Liberals a tremendous psychological boost," Taras said.

"It would also worry the Tories. This is home-field advantage for the Conservatives, the back yard. They take it for granted," he said.

Several national issues are playing out in the district of 125,000 people in a city of 1.1 million that serves as headquarters for the nation's energy sector.

The contentious $15.1 billion bid for Nexen Inc by Chinese state-owned oil company CNOOC Ltd, the Conservatives' strong promotion of increased oil exports and the environmental impact of oil sands output have all played out in debates.

Crockatt, a right-wing political pundit and former journalist, has proven to be a somewhat divisive figure, prompting some long-term party members who are more moderate to urge support for the Liberal candidate, lawyer and environmentalist Harvey Locke.

Crockatt has come under fire for being a no-show at many of the public debates, and Locke has been forced to deal with some anti-Alberta remarks by some of the party's national figures.

Chris Turner of the Green Party, an author, is running third but appears to be gaining support.

CONSERVATIVES ON DEFENSIVE

All parties have devoted large resources to the race, dispatching political big names to accompany the candidates as they knock on doors and attend events with polls showing the Conservative seat as vulnerable.

Voters in Calgary and throughout Alberta have surprised pollsters in recent years by electing candidates that do not exemplify the western Canadian province's image as being on the far right of the political spectrum.

Two years ago, Calgarians elected Naheed Nenshi, a politically moderate Muslim, as mayor over a candidate closely aligned with Conservatives, and Nenshi remains popular.

The mayor chastised Crockatt last week for avoiding public debates, especially one on municipal issues.

Last spring, Alberta re-elected Premier Alison Redford's Progressive Conservatives to the provincial legislature after many polls had predicted a win for the Wildrose party, which is politically and socially to the right.

A recent Forum poll showed Crockatt ahead with 35 percent, down from 48 percent in late October, and Locke holding steady at 30 percent. Turner has climbed to 25 percent support from 11 percent in October. The November 17 survey of 403 voters had a 5 percent margin of error.

The Liberals' support has been surprising as the federal party has been in the woods in Alberta since 1980, when the government of Pierre Trudeau instituted a National Energy Program that penalized the energy sector, which contributes most to the provincial coffers.

However, since the poll was conducted, David McGuinty, the Liberals' natural resources critic in Ottawa, accused Conservative politicians from Alberta of shilling for the oil industry and said they should "go back to Alberta."

McGuinty quickly resigned his post, and the Liberals distanced themselves from the remarks, but Crockatt seized on them as being indicative of the party's thinking.

Potentially damaging as well, two-year-old comments by Liberal leadership hopeful Justin Trudeau, saying Canada was "in bad shape right now because Albertans are controlling our community and social democratic agenda" were exhumed Thursday.

It is not yet known whether voters in Calgary Centre will look past the remarks, or fear that a long-standing East-West divide cannot be fixed.

(Reporting by Jeffrey Jones; editing by Todd Eastham)