Joseph F. Timilty was battling in 1975 to unseat Kevin H. White as Boston’s mayor. But weeks before the election, Timilty found himself running against the pitching arm of Luis Tiant and the home run dance of Carlton Fisk down the first base line.

The Red Sox played deep into October, going to the seventh game of the World Series — thanks to Fisk — and stealing attention from a competitive mayor’s race. This year, the Sox are making another playoff run. Baseball could keep dominating headlines until Halloween, which would be the seventh game of the World Series.

In a city obsessed with baseball and politics, baseball almost always wins — at least when it comes to voters’ attention.

The race to succeed Mayor Thomas M. Menino has already been overshadowed by a run of unrelated events, from the Marathon bombings to the trial of gangster James “Whitey” Bulger. Now, in the final stretch, mayoral finalists John R. Connolly and Martin J. Walsh find themselves fighting for the spotlight. In October, it’s tough to compete with the bat of David Ortiz or the glove of Dustin Pedroia.

“It takes the oxygen out of the air,” Timilty, who lost his mayoral bid, said in an interview Thursday. “Both candidates will tell you they need people to pay attention to their message. That’s how they are going to get people to come out and vote.”

Incumbents and front-runners tend to root for playoff baseball. Voters feel better about their city when the home team is winning. And baseball fever makes it hard for a challenger to gain notice.

This year, there is no incumbent. Connolly and Walsh are both hustling to introduce themselves to an apathetic electorate that has had the same mayor for two decades. This week, the candidates met for their first big televised debate, a prime opportunity to introduce themselves to voters.

But the debate overlapped with the American League Championship Series, pitting the Sox against Detroit. The Sox eked out a 1-0 victory against the Tigers — and swamped the mayoral candidates in the television ratings. According to WBZ-TV (Channel 4), the game attracted 979,500 viewers in metropolitan Boston. The mayoral candidates? 52,200.

“They may be the only two people rooting against the Red Sox who live in the city of Boston,” said John M. Tobin, a former Boston city councilor. “I think if Marty and John could have, they would have asked for divine intervention to help Torii Hunter catch that ball the other night.”

That ball was a game-tying grand slam by Ortiz on Sunday that sent Hunter flipping over a bullpen wall trying to make a catch. Both candidates adamantly denied they were praying for Hunter — or rooting against the Red Sox.

“The Red Sox and the playoffs are all encompassing,” said Howard Leibowitz, a longtime Menino aide and familiar face at Fenway Park. “But I don’t think it’s to the exclusion of politics.”

Did Leibowitz watch the debate?

“Unfair question,” Leibowitz said. “I think I know these candidates well enough that I focused on baseball.” (Disclaimer: He did follow the debate via Twitter.)

Baseball and politics have always been intertwined in Boston. The first pitch ever thrown at Fenway Park came from the right arm of a Boston politician, Mayor John “Honey Fitz” Fitzgerald, the grandfather of a future president. A Red Sox World Series run served as the backdrop to the polarizing mayoral race of 1967. (White defeated Louise Day Hicks and the St. Louis Cardinals beat the Sox in seven.)

“Baseball really is still the national pastime in the sense that it’s still a very reliable go-to, popular cultural activity that politicians can exploit with almost no downside,” said Jerold Duquette, a political science professor at Central Connecticut State University and author of the book “Regulating the National Pastime: Baseball and Antitrust.” “It’s the only sport where a politician throws out the first ball.”

Here’s another secret: Baseball can make the campaign trail friendlier.

“Voters are really happy to see you because they are really happy to see anyone when the Red Sox are winning,” said Connolly, who worked as a peanut hawker and hot dog vendor at Fenway Park.

But there are ground rules to stay on the right side of fans.

“It’s tough when the games are actually being played,” said Connolly, a city councilor. “You don’t want to phone bank, and you don’t want to knock on and interrupt anybody focused on the Sox game.”

Walsh follows the same guidelines. He said the Red Sox playoff run had not yet made a significant impact on the race.

“If they make it to the World Series,” Walsh said, “it might be a little different.”

Then the state representative had an idea.

“I would love it if Big Papi wore a Marty Walsh sticker on his hat in the seventh game of the World Series,” he said. “I don’t think it’s going to happen, but I wouldn’t mind it.”