Pablo Piatti's second drew the visitors level late in the second half after Philippe Montadon had been sent off, before the former Real Madrid man fired home a late winner
The hosts were in front thanks to goals from Stephane Besle and Goran Karanovic, the latter's coming just 10 minutes after Philippe Montandon had been shown a straight red card for bringing down Jonas in the area, before the Brazilian then saw his penalty saved by Daniel Lopar.
However, los Che's pressure eventually told, with Pablo Piatti netting his second of the match before former Real Madrid youngster Canales rifled home an unstoppable shop inside the final five minutes to secure a vital win for Miroslav Djukic's side.
Valencia started proceedings brightly in Switzerland and were rewarded for their attacking efforts after 30 minutes. Piatti, on for the injured Federico Cartabia, tapped home a rebound after Canales' free kick had rattled the post.
St Gallen responded well, with Vicente Guaita called in to action to deny Marco Mathys, and on 37 minutes they found their equaliser as Besle bundled home at the far post following a corner.
With the game finely poised early in the second half, momentum swung in Valencia's favour as Montadon received his marching orders for felling Jonas in the area, only for the Brazilian's tame effort from the spot to be kept out by Lopar.
And just 10 minutes later, St Gallen stole an unlikely lead; Dani Parejo's poor backpass was cut out by Karanovic, and the Swiss striker buried his finish past Guiata.
Valencia piled on the pressure, with Postiga hitting the post on 70 minutes, but they found their equaliser shortly afterwards as a fine move saw the ball drop to Piatti in the area, with the striker despatching his right-foot finish with aplomb.
With the Spaniards firmly in the ascendancy, a fifth and decisive goal looked likely to come from the men in orange, and Canales duly delivered with a thunderous left-footed drive from 25 yards to snatch a victory with just four minutes remaining.
The win moves Valencia a point clear of Swansea at the top of Group A, following the Welsh side's 1-1 draw with Kuban Krasnodar, while St Gallen sit third with three points.