The German side were two down going into the final minutes, but a crucial away goal from Vedad Ibisevic increased their chances of qualifying late on.
After half time the home side improved and they took a surprise lead with fifteen minutes to go when Benko found space in the box, and headed expertly past the goalkeeper.
Substitute Alexandru Maxim raced clean through with five minutes to go, but was denied by an acrobatic save from Vargic.
Rijeka then doubled their lead on the break as Benko found Zoran Kvrzic free, allowing the midfielder to fire past Ulreich.
In the final minute though, the Germans found a crucial away goal, with Ibisevic providing the finishing touch to a flowing team move down the right.