After drawing the first leg 0-0 away from home, Portadown's chances suffered a big blow at Shamrock Park when Ardian Cuculi scored an away goal for the visitors after just four minutes.
However, Richard Lecky equalised on the night in the 58th minute before Ross Redman got the winner just 10 minutes from the end with a free-kick.
Portadown will now play Croatian outfit Slaven Koprivnica in the second qualifying round.
Portadown (Northern Ireland) - Shkendija 79 (Macedonia FYR) 2-1 (halftime: 0-1)
First leg: Shkendija 79 - Portadown 0-0. Portadown win 2-1 on aggregate.
CS Grevenmacher (Luxembourg) - SK Tirane (Albania) 0-0 (halftime: 0-0)
First leg: SK Tirane - CS Grevenmacher 2-0. SK Tirane win 2-0 on aggregate.
Kalju Nomme (Estonia) - Khazar Lenkoran (Azerbaijan) 0-2 (halftime: 0-1)
First leg: Khazar Lenkoran - Kalju Nomme 2-2. Khazar Lenkoran win 4-2 on aggregate.
Floriana (Malta) - Elfsborg Boras (Sweden) 0-4 (halftime: 0-1)
First leg: Elfsborg Boras - Floriana 8-0. Elfsborg Boras win 12-0 on aggregate.