Jose Fuenzalida gave reigning champions Chile an eighth-minute lead but Enner Valencia equalized for Ecuador from the spot.
Sanchez bagged the winner, his 43rd goal for his country, but Chile finished with 10 men after Gabriel Achilier’s red card a minute from time.
The 30-year-old Sanchez started only nine Premier League matches, scoring just once, in an injury-interrupted season for the Red Devils in which he struggled to make an impact when he did play.
But he scored for the second game running in Salvador as Chile joined Colombia as the only teams to qualify for the knock-out stages after their first two games.
However, he revealed afterwards that he turned his ankle during the first half, aggravating an old injury.
“I think I have a sprain, I hope it’s not too serious. At half-time they strapped it up, I played on with a bit of pain,” he said.
Chile top Group C with a perfect six points ahead of their clash with Uruguay at Rio’s iconic Maracana on Monday.
Ecuador are left staring elimination in the face after a second straight defeat, knowing they must beat Japan in Belo Horizonte on Monday to stand any chance of progressing.
“We put in a huge effort but we’re making the mistake of switching off and that’s why they scored silly goals,” moaned Valencia.
“We’ll try and beat Japan and then see where that takes us.”
Chile began as they had left off in their 4-0 thrashing of Japan last Monday, opening the scoring after just eight minutes.
Ecuador made a hash of clearing a corner and Fuenzalida sent an angled volley from the edge of the area into the far bottom corner.
Ecuador brought the same muscular approach to the game that had seen them reduced to 10 men in their opener against Uruguay — a 4-0 loss.
Sebastian Mendez found himself in the referee’s book after just three minutes for a robust challenge on Charles Aranguiz.
Rushes of blood
However, it was Chile who were lucky to reach the break with a full complement after goalkeeper Gabriel Arias suffered two rushes of blood to the head.
First he clattered into Mendez inside the area, allowing Valencia to chip home the equalizer from the spot on 28 minutes.
Arias escaped further sanction, though, and that saved him five minutes before the break when he charged rashly out of his area to try to beat the speedy Romario Ibarra to the ball on the flank.
Ibarra went down from the slightest brush of contact and after a lengthy VAR delay, Arias was shown a yellow card.
In what proved a niggly encounter, referee Patricio Loustau showed nine yellow cards and a red.
“We lacked the intelligence to control the game after the first goal,” said Chile coach Reinaldo Rueda.
“Ecuador reacted really well and equalized in a moment in which we lost our shape.”
Chile were back in front early in the second period after more poor Ecuador defending.
Aranguiz was allowed to turn and cross far too easily on the right and Sanchez was left unmarked at the back post to side-foot a volley beyond the despairing dive of Alexander Dominguez.
Ecuador were bossing possession but were toothless up front, while Sanchez and Eduardo Vargas provided far greater cut and thrust for Chile.
Would you like to place a soccer bet? Click here to get started in 3 easy steps.