The on-loan Manchester United winger saw his 63rd-minute spot-kick saved by Mauro Goicoechea but Carlos Mane netted a last-gasp winner for last season's Primeira Liga runners-up
Marco Silva's men had been looking to kick-start their campaign after drawing their league opener at Academica a week earlier and the morale-boosting triumph they craved arrived in second-half stoppage time.
Nani, who was greeted with a rapturous welcome, made his second debut for his boyhood club after he returned on loan from Manchester United as part of Marcos Rojo's move to Old Trafford. However, his day did not completely go to plan.
The Portugal international impressed in flashes on the flank but he saw his 63rd-minute spot-kick saved by goalkeeper Mauro Goicoechea, much to the displeasure of usual penalty-taker Adrien Silva.
Nani was eventually replaced by Junya Tanaka and the Japanese attacker played a crucial role in the winning goal as he shot against the post in the 93rd minute and Carlos Mane, another substitute, tapped in the rebound.
There was no such late panic for Porto, though, as a 1-0 victory at Pacos Ferreira continued Julen Lopetegui's winning start in charge.
Porto received an early blow as Cristian Tello was forced off with a thigh injury after just 20 minutes.
The change did not prove to be particularly detrimental, however, as Tello's replacement Juan Quintero set up Jackson Martinez for the only goal of the game in the 40th minute.
The young midfielder lofted a deep cross in from the left and Martinez coolly struck a first-time effort across goal and into the bottom-right corner.