They were Lukaku’s first goals since October and took his tally to just four since returning from Chelsea in the offseason.
Porto midfielder Otávio was sent off following a second yellow card 12 minutes from time.
The second leg is on March 14 in Porto.
Inter has lost only once since the beginning of November, while Porto came into the match on a 22-game unbeaten run and had only let in two goals in its past 11 matches.
Lautaro Martínez was on a red-hot scoring streak but in the 13th minute he headed over the bar from point-blank range.
Inter went closer five minutes later but Porto goalkeeper Diogo Costa reacted swiftly to punch Hakan Çalhanoğlu’s cross-shot out from under the bar.
Porto withstood the Inter pressure well and had a chance of its own in the 27th minute but Marko Grujić fired over the bar.
The visitors then had two opportunities in quick succession as Inter goalkeeper André Onana parried Grujić’s effort and Galeno nodded the rebound wide.
The best chance — and the best save — of the half came in stoppage time as a free kick was whipped in from the right and Alessandro Bastoni seemed certain to score by the near post but Costa pushed his header away with his forearm.
It was Onana’s turn for heroics at the start of the second half with a double save to deny first Mehdi Taremi and then Zaidu.
Lukaku replaced Edin Džeko in the 58th and went close to breaking the deadlock but his cross-shot flashed past Martínez’s outstretched leg and the far post.
However, Lukaku then scored with four minutes remaining. His header from Nicolò Barella’s cross came off the left post but he tucked away the rebound.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)