Nicola Sansone gave Villarreal the lead at El Madrigal only for substitute Vlad Achim to equalise for the Romanians, who then had ex-West Bromwich Albion defender Gabriel Tamas sent off.
Villarreal won the game when Trigueros netted with a superb chip from just outside the box with two minutes left, and they go through as runners-up in Group L behind the Turkish side Osmanlispor.
Steaua had a chance to equalise in stoppage time, and while a 2-2 draw would have taken them through, instead they are eliminated.
Fiorentina are also through as winners of Group J after a 2-1 win over Qarabag in Azerbaijan secured by a 76th-minute goal from 19-year-old Federico Chiesa, son of ex-Italy striker Enrico. Chiesa was then sent off shortly after.
PAOK of Greece are also into next week's draw for the first knockout round thanks to a 2-0 win against Slovan Liberec, while Gent joined Shakhtar Donetsk in advancing from Group H.
Kalifa Coulibaly's stoppage-time strike clinched a 1-0 win over Konyaspor in Turkey and took the Belgians through at the expense of Braga, who lost 4-2 at home to Shakhtar.
The identities of the last six qualifiers for the knockout phase will be revealed later, with Manchester United needing a draw against Zorya Luhansk in Ukraine to advance from Group A.