Victory there and Djurgården - who won the Allsvenskan last year - will face the winner between Scottish champions Celtic and Icelandic KR Reykjavik in a single away match.
The second qualifying round will be played on 25–26 August.
The match Ferencvaros – Djurgården will be played in Budapest on 18 or 19 August.