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 was rewarded for its 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 into action to deny Marco Mathys, and 37 minutes in they found their equalizer 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 back pass was cut out by Karanovic, and the Swiss striker buried his finish past Guiata.
Valencia piled on the pressure, with Postiga hitting the post in the 70th minute, but it found its equalizer shortly afterward 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 control, 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 sits third with three points.