Vineyard voters will go to the polls to cast ballots in unusually close elections at the federal, state and local levels on Tuesday.

The closest of them, and one of the hottest contests in the nation, is the race for the 10th congressional district which includes the Cape and Islands. The most recent polling puts the seat, vacant due to the retirement of Democratic Cong. William Delahunt, as too close to call.

Five candidates are running, but the contest comes down to Democrat William Keating versus Republican Jeffrey Perry. Reportedly both parties are throwing huge resources into the campaign.

According to Federal Election Commission figures cited by the National Journal this week, the Democrats have put more than $820,000 into a last-week advertisement targeting Mr. Perry.

The National Republican Congressional Committee is likewise running attack ads against Mr. Keating, in what has become a negative campaign of unprecedented proportions.

Mr. Keating has hammered Mr. Perry over his personal integrity, particularly allegations that he ignored and then covered up a sexual assault on a teenage girl by a fellow police officer some 15 years ago.

And while Mr. Perry claims to have run an entirely positive, issues-based campaign, Mr. Keating has been attacked by Perry surrogates, the NRCC and other conservative groups over his liberal record.

Voters have a clear choice between Mr. Keating, who is on the progressive side of the Democratic party, and Mr. Perry, a self-proclaimed tea party supporter.

The contest for Massachusetts governor also is close, although polls continue to give an edge to the incumbent Democrat Deval Patrick over his challenger Charles Baker, a former health insurance executive and fiscal conservative.

Nonetheless, the Democrats have been concerned enough about the anti-Democrat, anti-incumbent sentiment abroad in the electorate that they have rolled out their big guns. President Obama was called in recently to stump for Governor Patrick.

Of lesser concern to the Democrats is the race for state senator for the Cape and Islands. Although it is an open seat — vacated by Robert O’Leary, who then lost the party primary for the 10th to Mr. Keating — Mr. Wolf appears to be comfortably ahead of his Republican opponent James Crocker.

Mr. Wolf, the founder and chief executive of Cape Air, has been endorsed by a wide range of local business organizations, environment groups and almost all state and local media.

The election for Cape and Islands state representative is no race at all; the only candidate is Tim Madden, a Democrat.

The hottest contest at the local level is the race for Dukes County sheriff. There are three candidates: the incumbent Michael McCormack, former state police Sgt. Neal Maciel and former Oak Bluffs police Det. Warren Gosson.

Mr. McCormack, a Democrat and a believer in rehabilitation and prevention, has been sheriff since 1999 and worked in corrections for 25 years before that. He runs on experience and his record. Mr. Gosson, who has qualifications in corrections but limited experience, is running on a platform of expanding substance abuse rehabilitation programs and enhanced criminal background checks to protect young people.

Mr. Maciel, who has no background in corrections, wants to enforce tougher discipline, including strip searches for work-release prisoners, and a stricter chain of command among staff at the department, which he characterizes as a “paramilitary” organization.

Mr. Maciel’s punitive approach won him the endorsement of the Martha’s Vineyard Times.

Mr. McCormack, meanwhile, has the endorsement of more than a dozen Island attorneys.

In an advertisement that appears in today’s Gazette, 14 lawyers who have had professional dealings with Mr. McCormack commended him as “professional, nonpolitical and responsive to the law-enforcement needs of the community.”

The third candidate, Mr. Gosson, also is advertising an endorsement, made 17 years ago by a former district court judge, since deceased, Herbert E. Tucker.

The endorsement lauds Mr. Gosson’s dependability and his character.

Another race which has developed momentum over recent days is that for Dukes County commissioner. Four places are to be filled, but only three names appear on the ballot.

But this week, Island attorney Benjamin Hall Jr. announced he was running as a write-in candidate.

Mr. Hall said he was interested in exploring the potential for regionalizing more services at the county level.

“I think the potential has always been there and I would like to play a role in helping making it happen in a broader way,” he said.

His other nominated issue was broadening the role of the county’s vermin control program.

“I see the giant rat that [program director T.J. Hegarty] has in the Fourth of July parade every year and I always think, it’s more than that. It’s really vermin control — there are skunks and raccoons whose populations are out of control with no natural predators on the Island, and it’s a public health issue,” he said.

Had he been the only write-in candidate, it would have rounded out the numbers nicely. Then another candidate put herself forward.

Incumbent Carlene Gatting of Edgartown who was undecided about seeking another term has since decided to seek reelection as a write-in candidate.

Voters also will elect nine members of the Martha’s Vineyard Commission. There are nine names on the ballot, all but one of them standing for re-election. The new name is Erik Hammarlund, another attorney.

Island voters will be asked to take action on three statewide ballot questions placed before them by initiative petition. One proposes to reduce the sales tax on alcoholic drinks. The second would repeal Chapter 40B, the state affordable housing law. The third would cut the state sales tax from 6.25 to three per cent.

In addition, Vineyard, Falmouth and Nantucket voters will also be asked to take action on a fourth, non-binding ballot question that would allow the state to regulate and tax marijuana as it does alcohol.

Finally, Chilmark voters will take part in a dual election and receive a separate ballot with one question on it. They will be asked to approve a Proposition 2 1/2 override to pay for a bond issue to replace the pier connector destroyed in the July 12 Menemsha fire, by exempting the expenditure from the provisions of the state tax cap.

Given the unusually tight nature of several of the races, there will be more obvious political activity around the Island than usual. Yesterday saw Democrats stationed — not for the first time this election cycle, at Five Corners in Vineyard Haven. The local party also plans a series of phone banks to lobby voters over the coming days.

Polls will open at 7 a.m. Tuesday and close at 8 p.m. in every Island town.