Chelsea forward Islam Feruz netted a double in Setubal, striking after 12 and 21 minutes to put the visitors 2-0 up, but goals early in the second half from Paulo Oliveira and Aldair levelled matters.
Oliveira then converted a 68th-minute penalty when Lewis Toshney was adjudged to have handled in the box.
With regular boss Billy Stark in interim charge of the senior side following the departure of Craig Levein, youth coach Ricky Sbragia took charge.
The diminutive Feruz opened the scoring by heading in from a corner and got his second after out-running the Portugal defence.
Seven minutes into the second half Oliveira converted a free header and four minutes later Aldair equalised despite an effort to clear the ball off the line.