Richarlison had given Brazil the lead on 64 minutes and Neymar sealed the win deep into injury time, but only after another VAR farce.
Referee Alexis Herrera initially gave a free-kick against Gabriel Jesus after contact between him and Angelo Preciado in the Ecuador area five minutes from time.
But after an interminable four-minute VAR review, he changed his mind and awarded a penalty.
Neymar stuttered in his run-up but Ecuador goalkeeper Alexander Dominguez wasn't fooled and easily saved his weak shot.
Ecuador were then down the other end attacking when Herrera blew his whistle and brought the game back for encroachment by Dominguez.
Neymar retook the penalty and this time sent Dominguez the wrong way.
The slapstick ending could not mask a deserved victory for Brazil, who now top the qualification table by four points from unbeaten Argentina, with Ecuador third, two points further back.
Predictably, Brazil dominated the early possession with 75 percent of the ball in the first quarter of an hour.
But it wasn't until 20 minutes that they first threatened with Richarlison millimeters away from turning home a whipped inswinging Neymar freekick.
Moments later Richarlison played Gabriel in on goal but Dominguez was out quickly to smother his poked effort.
Ecuador were their usual physical selves but showed little of the attacking verve that had seen them score 13 goals in their previous three matches.
Neymar in particular felt the full force of Ecuador's muscular approach.
Brazil thought they'd gone in front three minutes before the break when Gabriel converted a
right wing cross from Danilo but Ecuador were saved by a narrow offside call.
A minute later Dominguez had to scoop behind a rasping long-range drive from Neymar.
Ecuadoran chances were few and far between, with fullback Preciado blazing over from 20 yards on 58 minutes.
Brazil coach Tite had seen enough and brought on forward Gabriel Jesus for defensive midfielder Fred, who was making his first appearance for the Selecao since 2018.
The switch paid instant dividends. After Domingiuez saved low to his right from Neymar, he was poorly beaten on 64 minutes at his near post by a shot from Richarlison.
It was one-way traffic and Marquinhos headed over the bar before Dominguez made partial amends for his earlier clanger, saving low to his right to deny Gabriel Jesus and then blocking a shot from Gabriel with his foot.
Gabriel, whose nickname is Gabigol, then headed wide of an empty net from Richarlison's cross on a lightning counter-attack after Dominguez made a rash dart out of his area.
But the true drama came at the end of the match as VAR once again stole the headlines.
Brazil travel to Paraguay on Tuesday while Ecuador host Peru, before the Copa America begins in Brazil on June 13.
Highlights neymar World Cup qualifiers Brazil