© Getty Images
Fede Cartabia and Postiga both had chances in quick succession for Valencia, but their efforts on goal failed to trouble the keeper before Sergio Canales fired a free kick against the post from 20 yards with Lopar beaten.
On the half-hour mark, the visitors took the lead. Canales hit the post with another free kick but this time Pablo Piatti was on hand to slot home the rebound.
St Gallen were reduced to 10 men in the 56th minute, when Montandon was sent off for bringing down Jonas inside the area. The Valencia striker stepped up to take the spot kick, but Lopar saved his effort.
They were soon made to pay for that miss as the home side took the lead. Karanovic drove into the box, past the visiting defence, before firing a strike past Vicente Guaita.
Valencia hit the post for the third time in the match through Postiga, before Piatt drew Valencia level with his second of the game after reacting the quickest to Canales's blocked shot.
With four minutes left to play, the visitors scored their third of the night. Canales picked up the ball 30 yards from goal, before curling a strike into the bottom corner and earn his side an important win.