Brazil’s Neymar reacts at the end of 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. (AP Photo/Michael Sohn)

Philippe Coutinho and Neymar both scored in second-half stoppage-time to give Brazil a crucial 2-0 win against Costa Rica at Krestovsky Stadium in St Petersberg.

Coutinho finally broke the deadlock in the 91st minute before Neymar found the net in the dying seconds to secure Brazil’s first victory of the 2018 World Cup.

The result sees Brazil move top of Group E ahead of Serbia, who play Switzerland at 7pm in Friday’s evening match.

A second straight defeat for Costa Rica in Russia means they cannot qualify for the knockout stage like they did at the 2014 World Cup.

It looked as though it wasn’t going to be Brazil’s day when, in the 78th minute, they had a penalty decision overturned by VAR.

Referee Bjorn Kuipers changed his original decision to award a spot-kick for a challenge on Neymar by Oscar Duarte after watching a VAR replay pitch-side.

Despite Brazil’s dominance, Costa Rica could have taken the lead after 13 minutes when Celso Borges fired a great chance wide after an excellent run and cross by Cristian Gamboa.

Brazil had the ball in the net in the 26th minute but Gabriel Jesus was offside as he lashed home from 15 yards.

The tournament favourites struggled to test Costa Rica and Real Madrid goalkeeper Keylor Navas in the first-half as they were largely limited to long-range efforts.

Douglas Costa’s introduction at half-time helped spark Brazil into life at the start of the second-half, with chances falling to Neymar, Coutinho and Costa himself within 15 minutes of the restart.