Raków on Wednesday drew with the Azerbaijani team 1-1 away in the second leg of their Champions League round two qualifier.
Croatian right-back Fran Tudor put Raków 1-0 up in the 52nd minute of the game in Baku.
Albanian striker Redon Xhixha drew Qarabag level eight minutes later.
Raków defeated Qarabag Agdam 3-2 in the first leg of their Champions League round two qualifier last week.
The Polish champions will now face Cypriot side Aris Limassol in the third round of Champions League qualifiers.
Qarabag Agdam, meanwhile, will be relegated to the lower Europa Conference League.
To qualify for the Champions League group stage, Raków need to eliminate Aris Limassol and one other rival, Poland's PAP news agency reported.
Raków in May won the Polish premier league championship for the first time, while heavyweights Legia Warsaw, the most successful Polish football club in history, finished runners-up.
(gs)
Source: IAR, PAP