Brazil made a change at the break, bringing on Douglas Costa for Willian, and their bright start to the second period was nearly rewarded when Jesus crashed a header against the bar after 49 minutes.
However, they lacked poise in front of goal and Costa Rica keeper Keylor Navas was in fine form.
Brazil's Neymar reacts after missing a chance to score during the group E match between Brazil and Costa Rica at the 2018 soccer World Cup in the St. Petersburg Stadium in St. Petersburg, Russia, Friday, June 22, 2018.
Brazil is tied on four points with Switzerland and it isn't yet certain if finishing first or second in the group would be better ahead of a last-16 match against a team from Group F, which contains Germany, Mexico, Sweden and South Korea.
Brazil's second goal was timed at 96:49 - the latest recorded stoppage time goal in a World Cup match since 1966.
Brazil's coach Tite also commented on his players tears, suggesting they could be down to the huge pressure of leading the five-times world champions. While acknowledging that Neymar has had a torrid buildup to the tournament, with surgery for a broken foot bone and a hugely disappointing first game against Switzerland, Globo said the tears were just too much.
Brazil attacked relentlessly in the second half and was awarded a penalty in the 78th when Neymar was impeded as he cut inside defender Giancarlo Gonzalez.
On the 83 th minute of the match when the score was 0:0 Neymar began to swear at Silva when the captain returned the ball to the Costa Ricans after stopping in the spirit of fair play. "His artistic gesture cost Brazil the penalty", Globo TV commentator Galvao Bueno said on air.
However, Argentina's uphill battle to qualify for the knockout phase might have been aided by Nigeria's 2-0 win over Iceland on Friday that leaves Group D intriguingly poised.
The question now is how he approaches the last group game against Serbia. They had met previously on 13 occasions when Serbia was a part of Yugoslavia.
The combined prayers of Nigerians and Argentinians, who face imminent exit from the World Cup if Iceland were to win, seems to have worked against Iceland.
"We don't need referees decisions to win a game", Tite said.
Aleksandar Mitrovic gave Serbia the flawless start after five minutes, but the Swiss gradually worked their work back into the game in rainy Kaliningrad.