Polling firm Datafolha said former president Lula would get 43 per cent of the votes compared with 26 per cent for Bolsonaro in a first-round vote if the election were held today.
Datafolha said the government's Auxilio Brasil social welfare program started in December helped Bolsonaro gain four points since the previous poll, while Lula is down five points.
If the two men, who have yet to formally declare their candidacies, face off in a second-round run-off, Lula would win with 55 per cent of the votes versus 34 per cent for Bolsonaro, a 21-point gap that has fallen from 29 points three months ago.
Lula's advantage is in line with other recent polls that showed Bolsonaro advancing.
Still, Datafolha said accelerating inflation and high fuel costs driven up by the Ukraine war may still have an impact on voter intentions seven months from the election.
Bolsonaro improved his numbers by toning down his anti-vaccine and sceptical comments about the gravity of COVID-19, Datafolha said, and he may have benefited from the relief Brazilians are feeling with the easing of pandemic restrictions.
Statistically tied in third place are former Justice Minister Sergio Moro, a judge who jailed Lula on corruption charges that were later dropped, and former Ceara Governor Ciro Gomes, both down a point to eight per cent and six per cent respectively.
Datafolha polled 2556 voters in 181 cities across Brazil between March 22-23.Â