The result gives the Sicilians an excellent chance of progressing when they play the second leg in Palermo in three weeks.
The winners will face either holders Inter Milan or Roma in the final, with the nerazzurri holding a 1-0 advantage following their win in Rome on Tuesday.
Zlatan Ibrahimovic gave Milan the lead but Urby Emanuelson had to come to their rescue after Javier Pastore and Abel Hernandez had turned the tie on its head.
Having been banned for three of Milan's last four matches and with two more games left on his latest league suspension, Ibrahimovic wasted no time in reminding the club's fans of his abilities.
The hosts went in front after just four minutes as Palermo allowed Massimo Oddo's deep cross to arrive all the way to the back post where Ibrahimovic had the simple task of volleying home from close range.
Palermo came roaring back.
Pastore teed up Maurizio Pinilla whose volley from 15 yards in a central position was unfortunately straight at goalkeeper Marco Amelia.
But on 14 minutes it was all square as Pastore played a one-two with Pinilla and burst past the hesitating Sokratis Papastathopoulos before finishing crisply left-footed across Amelia.
In an even game the recalled Antonio Cassano played Ibrahimovic clean through but instead of shooting he tried to tee up Kevin-Prince Boateng and his pass was cut out by Dorin Goian.
The visitors were close to going in front on 35 minutes after a brilliant move between Pastore and Antonio Nocerino, who set up Pinilla but the Chilean slipped as he went to shoot and fired over.
Pastore then flashed a shot from wide right across goal that Amelia just finger-tipped around the post.
Milan had a pair of chances just before the break as Boateng thrashed wide from distance and Ibrahimovic met Oddo's cross at the near post only for Salvatore Sirigu to scrambled it around the post.
Milan were proving brittle at the back, though, and Pastore slipped Hernandez in behind the defence to crash an unstoppable shot in off the underside of the bar eight minutes after the restart.
Milan expectedly started to push forward and enjoyed the lion's share of possession and territory but Palermo had a great chance on the break as substitute Josip Ilicic sent over a cross to the far post where incredibly it was centre-back Cesare Bovo who arrived to slice a volley off target.
However the equaliser came on 76 minutes as Ibrahimovic caused havoc with quick feet in the box and although Goian tackled him, the ball broke to Emanuelson to rifle home.
Milan almost gave up another goal immediately as Papastathopoulos and Oddo got in eachother's way leaving Pastore to run clean through but Amelia made a brilliant one-handed save.