The Portugal winger opened the scoring with a third-minute penalty, before then scoring his 50th goal for his club just seven minutes later.
Bayern did pull a goal back thanks to Thiago Alcantara???s strike after 28 minutes, but striker Jackson Martinez ensured Porto recorded their first-ever home win against the Bavarians by slotting home 20 minutes after half-time.
The home side made a dream start to proceedings when being awarded a penalty after just 90 seconds after Bayern midfielder Xabi Alonso was caught in possession just outside his penalty area by Porto striker Jackson Martinez.
The ever-alert Colombia international then bore down on Manuel Neuer, before rounding the goalkeeper, only to be upended by the shot-stopper before he was able to put the ball in the back of the net.
Referee Carlos Velasco Carballo wasted no time in pointing to the spot, although Neuer was lucky to escape with only a booking, before Quaresma kept his cool to send the Bayern No. 1 then wrong way from the spot.
However, if Bayern head coach Pep Guardiola thought that piece of defending was bad, then he would have been dismayed to see his team make an even worse error after 10 minutes when centre-back Dante was also robbed of the ball in a dangerous position by that man Quaresma.
And hardly believing his luck, the Portuguese raced away clean through on an unprotected Neuer to fire Porto into a shock 2-0 lead, a goal that was greeted with delirium by the home fans in a rocking Dragao.
The stunned visitors, whose only effort on goal inside the opening quarter of the match was a Robert Lewandowski header that just cleared Fabiano???s crossbar, however, got themselves back into the contest by scoring a vital away goal just before the half-hour mark.
Bayern right-back Jerome Boateng made a storming run down the right flank and the defender???s low centre somehow made its way all the way through a posse of players in the box, before an unmarked Thiago Alcantara found himself in the right place to score his first-ever Champions League goal from close range.
But if that strike came against the run of play, Porto???s players did not let their heads fall, with Julen Lopetegui???s side responding by almost scoring a third goal just before half-time, only for the lively Carlos Casemiro to head Quaresma???s inch-perfect free kick from the right-hand byline wastefully over the bar.
But that miss was soon forgotten as Porto came out after half-time again attacking right from the very off in search of a third goal, with Neuer having to be at his very best to prevent team-mate Jerome Boateng from scoring an own goal with a world-class stop at his near post after 57 minutes.
The Portuguese champions, though, were not to be denied, as just eight minutes later Martinez fired them 3-1 ahead, although yet again Bayern defender Dante was at fault for the goal after misjudging the flight of the ball and allowing the Porto captain with a clear run on goal.
Martinez still had work to do, however, to calmly round Neuer and net his sixth strike in just seven Champions League games this season, and all this after the player was a doubt in the build-up to the game with injury.
Thereafter Porto managed to keep their opponents at arm???s length to ensure they take a two-goal lead with them into the return leg at the Allianz Arena on Tuesday, a tie in which they will be without both their first-choice full backs through suspension as they look to finish the job in Bavaria.