Zlatan Ibrahimovic had given the hosts 1-0 up, but Palermo fought back to bring the score to 2-1 after Javier Pastore and Abel Hernandez broke through the AC Milan defence.
Fortunately for Allegri, Urby Emanuelson came to the rescue with an equaliser to bring both sides to parity.
Allegri heaved a sigh of relief after the game, saying to Rai: "We started well and took a lead, but then we allowed them to draw".
"After Palermo created problems on the break and we risked conceding a third goal, but it's important that we didn't lose to keep the competition open.
"Now we have to focus on league, but we will go there looking for the final in Palermo."
The Rossoneri's defence appeared laboured during the match, but Allegri feels they coped well. He also defended Antonio Cassano who had an average display.
"They had a good game as Palermo have quality and it was not easy for them," he added.
"Cassano did good things, but what's important is that we didn't lose and now we have to go there [to Palermo] in good condition for the return leg."
The second-leg will be in Palermo on May 10.