RIO VERDE, Brazil—Toiling on the dusty plains of central Brazil, Edilamar Caetano and her husband had long been loyal supporters of Luiz Inácio Lula da Silva, the leftist front-runner in next month’s presidential elections whose own family worked the land as farmhands.

In April, President Jair Bolsonaro, the former army captain who took office four years ago promising fiscal restraint and a smaller state, came to town. He gave Ms. Caetano and her husband, Wagner Vieira, a title to 84 acres they had been farming as squatters, delivering the paperwork personally with an awkward hug in a local ceremony.

They said they dropped their support of Mr. da Silva, a former leftist president, and Brazil’s right-wing leader notched two more votes.

“Thanks be to God! Thanks be to Bolsonaro!” said Ms. Caetano. “It’s one of the best things that ever happened to us—we never could have afforded a plot of land this big. It changed our life.”

Brazilians like Ms. Caetano have found themselves at the center of what has become a cutthroat battle for the votes of the rural and urban poor ahead of October’s election—a vast and politically fickle sector of the population that pollsters say will likely decide the race in Latin America’s biggest country.

From giving land titles to cash handouts, Mr. Bolsonaro—once a disciple of small government—has embraced his “inner interventionist,” said Rafael Cortez, a political scientist at São Paulo-based consulting firm Tendências. The president must pry back enough poorer voters to add to his large following among wealthier Brazilians if he is to have a chance of being elected for a second term.

Mr. Bolsonaro has given out some 410,000 land titles—more than Mr. da Silva’s Workers’ Party awarded in 13 years in office, according to Brazil’s federal Institute for Colonization and Agrarian Reform.

In July, Mr. Bolsonaro asked Brazil’s Congress to approve some $8 billion for social spending this year by declaring a state of emergency in the country, allowing him to circumvent rules that prevent extra expenditure ahead of elections. The amendment provided the funds for $120 monthly handouts for the poor, cooking gas subsidies, free transport for the elderly, payouts for taxi drivers and truckers to compensate for higher gasoline prices, and cash for states to reduce fuel prices at the pump.

The initiatives have drawn comparisons to Mr. da Silva’s government, which spent handsomely on public support during a run of two terms that ended in 2010.

Wagner Vieira, pictured with his son Eduardo, had been farming the family’s land as a squatter before the president’s intervention.

Photo: Tuane Fernandes for The Wall Street Journal

“Lula and Bolsonaro are basically playing the same game,” said Tony Volpon, a former Brazilian central banker and chief strategist of the WHG asset-management firm. Both candidates plan to focus on generous spending on the poor, while taxing the rich—a disappointment for business leaders who argue that they already pay too much tax for a country that gives little back in the form of decent public services, such as healthcare or security.

Mr. Bolsonaro shifted his stance on taxes and public spending largely because of the pandemic. Brazil struggled to cope with soaring fatalities that left the country with the world’s highest death toll after the U.S. Close to 60% of Brazilians said they disapproved of the president’s handling of the pandemic in an Ipespe/Abrapel poll this month. Then came an economic blow, with double-digit inflation and joblessness rising to near 15%.

Mr. Bolsonaro’s recent generosity is beginning to bring some voters around. With a week until the first round of voting on Oct. 2, Mr. da Silva’s lead has narrowed to 14 percentage points, down from 21 in May, according to pollster Datafolha.

Some 24% of Brazilians who earn less than twice the minimum monthly salary of around $230 said they would vote for Mr. Bolsonaro in September, up from 20% in May. Mr. da Silva’s support in that group remained around 57%.

Low-earning Brazilians in areas such as the favelas of São Paulo have been stung by rising consumer prices.

Photo: Andre Penner/Associated Press

Despite the gains, winning over poor voters is an uphill battle for Mr. Bolsonaro, who has shown up at campaign stops with wealthy entrepreneurs in tow and has criticized those receiving state benefits in the past, accusing them of not wanting to work.

Mr. da Silva rose from poverty to become Brazil’s first working-class president in 2003. Despite serving more than a year in jail for corruption until his release in November 2019, he is still widely popular among the poor for spending handsomely from a commodities boom. He is especially beloved in his native northeast, Brazil’s poorest region.

“I can’t see a future if Bolsonaro is elected,” said Paulo Vinicius Portela, 28, who has struggled to find work in Recife, one of the biggest cities in the northeast. “All my neighbors are voting for Lula, all the poorer families here…He’s going to crush Bolsonaro.”

President Jair Bolsonaro, backed by wealthier voters in the past, faces the challenge of expanding his support base.

Photo: Sandro Pereira/Zuma Press

Luiz Inácio Lula da Silva holds a substantial polling lead ahead of next month’s elections.

Photo: Matheus Pe/Zuma Press

The economy is the main priority among Brazil’s voters, polls show. About 33 million Brazilians are going hungry, compared with about 19 million people at the end of 2020, according to the research group Penssan.

“I just want to be able to eat meat again,” said Francisco Marcos, a fruit seller and father of four from São Paulo.

With rising food prices, he hasn’t been able to tuck into a steak for more than a month, he said as he held his 4-year-old daughter while hoping to catch a glimpse of Mr. da Silva outside a campaign event.

“He’s the only one who looks out for us,” Mr. Marcos said.

But while Mr. da Silva is a natural shoo-in for many poor Brazilians, he has one major weakness that is advantageous for Mr. Bolsonaro: evangelical Christians, who now make up a third of the population. Wooed by his socially conservative messages attacking abortion and same-sex marriages, evangelicals voted en masse for Mr. Bolsonaro in 2018.

A 12-hour drive into the heart of Brazil’s hinterland in Rio Verde, locals’ minds are made up, said Maria de Lurdes Mota, who said she owes the president for the deep orange earth beneath her feet.

Mr. Bolsonaro handed over a title to the land where she and her husband have been raising cows for a decade. They now plan to use the 120-acre plot as a guarantee to apply for a loan to expand their small cheese-making business, she said.

“I’ll vote for Bolsonaro,” she said. “We all will.”

Write to Luciana Magalhaes at Luciana.Magalhaes@wsj.com and Samantha Pearson at samantha.pearson@wsj.com