The first leg win gives Warren Feeney's team a huge incentive when the sides meet again in the return leg next Thursday night.
This was a tremendous performance by Linfield against a full time outfit and fully deserved.
The Blues made an encouraging start to the game with Stephen Lowry heading over the bar, but they had to adjust in midfield on 20 minutes with Sean Ward coming off the bench to replace the injured Jamie Mulgrew.
Linfield still looked the more likely to score and Michael Carvill saw his effort gathered easily by the keeper.
The visitors never really got on top but they did look dangerous when in the box with Goitom and Jonsson both in good positions but failing to test Tuffey in the Linfield goal.
The best chance of the half fell to the Blues on 40 minutes, Carvill setting up Peter Thompson but his effort flew inches over the bar.
The Swedes had two early chances in the second half through Igboanaike and Pavey but the Blues responded with Lowry on the end of a Carvill pass but he could not make it count.
The turning point in the game came on 71 minutes. Bahoui got behind the Linfield defence and looked certain to score but his shot hit the post and Igboananike lifted the rebound over Tuffey's goal.
A let-off for the Blues and they took advantage of it with Sean Ward denied a spectacular goal two minutes later thanks to a super save.
The breakthrough finally came with nine minutes to go, sub Andy Waterworth latching onto a ball over the defence and firing past the exposed keeper.
Meanwhile there was no joy for Derry City as they went down 1-0 at The Brandywell to Shakhtyar Soligorsk.
The decisive goal came on 27 minutes as Yanush cashed in on some slack defending in the City defence.
The Belarusians were always posing a threat with City rarely posing problems in the opposing box.
City keeper Gerard Doherty did well to deny Yurevich on eight minutes and was relieved to see an effort from Kuzmianok smash off the bar soon after.
Then came a gift for the visitors, a poor back pass from Shane McEleney was picked up by Yanush and he gave Doherty no chance.
The chances continued to fall to Shakhtyar and Doherty was kept busy between the posts.
It was more of the same in the second half with the City stopper continuing his heroics and with 20 minutes to go a rare break for Derry came when Rory Patterson saw his shot beat the keeper but the ball was eventually cleared off the line.
A home defeat for City and they can expect another tough 90 minutes in the away leg next week.