Gladbach drew 2-2 in an exciting game in Spain, but needed a win to secure progression. Wolfsburg lost 2-0 at home to Everton, despite playing more of the football and having more of the chances.
Inside the El Madrigal stadium, it was the hosts who started the better and it took some last-ditch defending from Gladbach to prevent an early goal. Aside from a counterattack that Branimir Hrgota and Raffael overplayed, Gladbach were off the pace.
Villarreal captain Bruno looked to have headed the home side into the lead on the quarter hour mark, but Raffael headed off the line. It wasn't long before Villarreal did get it over the line though. Luciano Vietto was a constant threat and after a good ball by Jaume Costa, the attacker burst through and poked home to give the home team a deserved lead.
Lucien Favre's side, without Martin Stranzl or Christoph Kramer, looked far too passive and Villarreal sought a second. Manu Trigueros' first time shot had to be palmed over by Yann Sommer, before the same man fired wide minutes later.
Fortunate to be down by just the one goal, Gladbach sought to show a different side in the second 45 minutes. Granit Xhaka's free kick was saved by Sergio Asenjo, as was Hrgota's rebounding volley before Raffael flashed a shot wide of the far post.
Favre's men were growing in confidence and were rewarded moments later when Raffael's swirling shot went in off the wrist of Asenjo. With the visitors level and enjoying a passage of control, the game looked a different one to the first half. Exactly at that moment, a poor clearance from Julian Korb allowed Denis Cheryshev to put Villarreal back in front.
Four minutes later, Gladbach equalized again as Granit Xhaka thundered in a free kick off the bar from 30 yards to lay an early claim for the club's goal of the season. Two quick goals were followed by a slower tempo that set up a finale that promised much but delivered little.
With the other game in Group A ending in a 3-1 win for Zurich, Gladbach now only need a draw against the Swiss side in the final group-stage game to progress.
Wasteful Wolfsburg overpowered
In the battle for top spot in Group H, Wolfsburg got off to the better start as they sought revenge against an Everton side who dispatched of them in the reverse fixture.
Ivan Perisic was at the heart of all of Wolfsburg's attacking intent in the early stages, but it was in fact Everton's Sylvain Distin who came closest to scoring when his header clipped the top of the bar. Immediately afterwards, Wolfsburg worked their best chance but Tim Howard palmed Aaron Hunt's rasping drive out for a corner.
The game opened up and Perisic thought he had taken advantage when he tapped in Nicklas Bendtner's flick. The linesman flag went up, but the replay showed the call to be incorrect.
It proved costly too, as Wolfsburg's superiority ended with a goal for the visitors. Defending a corner, Everton broke at pace and Romelu Lukaku robustly won the ball off Junior Malanda before surging through and firing past Diego Benaglio.
During the break, it was confirmed that Lille had drawn against Krasnodar. That result confirmed Everton's progression out of the group, but left Wolfsburg needing a point to do the same.
Poor fortune for Wolves
Bendtner, starting for the first time in Wolfsburg colors, thought he had found the goal to get them that point when he headed in at the back post from a corner. Again the flag went up though and the goal was disallowed - this time the decision was the right one.
With Wolfsburg struggling to score a legal goal, Everton missed the chance to score an easy one when Aiden McGeady blazed over from close range.
The hour approached, and the game's tempo sped on. Perisic shot onto the post before Howard palmed another of the Croatian's shots to safety. Wolfsburg continued to hound Everton's goal in search of that invaluable equalizer, but Howard or the defense continually got in the way.
In almost a carbon copy of the first half, Everton doubled their lead. Lukaku powered his way through midfield before feeding Kevin Mirallas. The Belgian winger, who had been denied by Benaglio in the first half, slotted into the far corner to end the contest.
For all of Wolfsburg's efforts, a lack of attacking composure and luck left the home side empty handed. Perhaps more worrying than the defeat is the fact it was Wolfsburg's first home game in 26 attempts without a goal. However, a draw against Lille in the final group game would be enough to progress in second spot.
Elsewhere in Europe
Defending champions Sevilla suffered a 2-0 defeat to Feyenoord, a result which put the Dutch side top of Group G. Fiorentina, who had already qualified before their game, won 2-1 against Guingamp - Marko Marin scored the opener. Napoli drew 0-0 away at Sparta Prague.
Salzburg beat Celtic 3-1 in Scotland to make it four wins from five in Group D, while ten-men Inter won 2-1 against Dnipro who missed a first-half penalty. Tottenham battled to a 1-0 home win against Partizan, while Estoril against PSV was abandoned at 3-2 (for the home side) after 45 minutes due to a waterlogged pitch.