BAD HOMBURG, Germany — Europe has barely been mentioned in the German election campaign. But in the final days before Sunday’s vote, a fringe party that wants to scrap the euro is gaining in the polls, threatening to scramble the country’s consensus politics with a message that has echoes of the Tea Party in America and rightist movements elsewhere in Europe.

Chancellor Angela Merkel’s Christian Democrats are expected to emerge victorious from the elections. But polls are giving the upstart party, Alternative for Germany, a decent chance of winning seats in Parliament for the first time. Its surprising strength could have an outsize effect on the shape of the next German government and help determine how far it can go in satisfying the desire among its European Union partners for more forceful steps to end the Continent’s economic crisis.

A small but committed minority of Germans see the party as the only alternative to mainstream parties too timid to admit that the euro has failed. And the party has offered a home to more socially conservative Germans who are unhappy with the way Ms. Merkel has pushed the conservative bloc to the center on social issues like gay rights.

In recent days, there has been a sense of euphoria among Alternative for Germany’s supporters about its chances of winning a share of power. “I am convinced they will get into the Bundestag,” said Ingrid Cook, 63, who lives in Bad Pyrmont, in northwestern Germany, and translates technical manuals for a machinery company.