Midfielder Valter Birsa put the visitors ahead with a swerving 20-yard shot, and Nejc Pecnik sealed victory three minutes into injury-time to leave Slovenia two points behind leaders Slovakia going into Wednesday's final round.
Valter Birsa's 87th-minute winner handed Torino a 2-1 victory over Atalanta, while Juraj Kucka's 33rd-minute goal was enough to see Genoa creep further away from the drop zone with a 1-0 win over Udinese.