Jason Woodward scored a first half try for Gloucester who went to halftime 14-21 down but they were unable to add to their score in the second half
Leinster will face the beleaguered Saracens side that learned they will be relegated from the Premiership for salary cap reasons.
Exeter gained a home game against Chris Boyd's Northampton side while Clermont Auvergne will host Racing 92.
Northampton beat Lyon 36-24 in Lyon but had to come back from 5-17 down at halftime.
Boyd said the support the side enjoyed from travelling fans had been amazing.
"Even during the game, the chants that were coming were generally from the Northampton Saints faithful. We applaud them for travelling," he said.
"We love playing at home at the Gardens and it's a very special place with a very special group of supporters, and it's great that they come on the road and we've got a victory for them."
It was Northampton's first win in France for nine years, ending a run of 11 defeats across the English Channel.
"Individually those big [Lyon] power athletes can create a problem, but when you have a collective, particularly in your forward pack, where they have two players and we have three or four, it makes a difference," Boyd said.
In the Challenge Cup, Brad Mooar's Scarlets had a 33-14 bonus point win over London Irish to claim eighth place in the quarterfinals. They will travel to Toulon for their game.
"We are genuinely excited. We have had a couple of games against Toulon. They're an outstanding side and a great club," Mooar said.
Toulon beat the Scarlets home and away in pool play.
"That's a great challenge for us to go back and have another crack at them. We are thrilled to be in the playoffs," he said.
Leicester will play Castres, Bourdeaux will play Edinburgh and Pat Lam's Bristol will play the Dragons.
However, it wasn't until a last minute try and conversion that Bristol learned its fate in a 7-7 draw with Zebre.