The Scottish Premiership giants began brightly but could have fallen behind on the quarter-hour mark.
Rangers brushed themselves off and went on to open the scoring in the 23rd minute through Jamie Murphy.
The 28-year-old picked up James Tavernier's crossfield pass and planted a left-foot shot into the far corner of the visitors' net.
Rangers finished the first half strongly but could not add to their opener, and lacked composure in the second period as they struggled to find a second goal.
However, Murphy was brought down in the box two minutes into second-half stoppage time, earning Gers a penalty against the Macedonian side.
Tavernier, the provider for Murphy's goal, stepped up and duly converted from 12 yards to give the Glasgow side more breathing room.
The second leg of the tie takes place in Skopje on Tuesday, July 17.
RANGERS (4-3-3): McGregor; Tavernier, Goldson, Katic, Flanagan; Candeias (Jack 56'), McCrorie, Arfield (Ejaria 67'); Windass (Middleton 79'), Morelos, Murphy
SHKUPI (4-2-3-1): Zendeli; Adem, Tipuric, Bajrami (Bilali 46'), Nchama (Krivanjeva 90'); Vujcic, Broja; Stojkoski, Muharem, Ljamcevski (Shabani 60'); Ilijoski