The Rossoneri scored two goals in the last three minutes to take all three points and give Clarence Seedorf his second consecutive league victory as manager of the club.
"The first half hour was good, we created chances," Kaka told Milan Channel. "After they scored everything became more difficult, but we had the character to be successful and take the three points in the end.
"We're not playing very well. In the end, we've played simpler and by paying attention to the details we were able to catch up. Winning a game like this, that seemed lost to all except for the team and the AC Milan fans, is crucial for the near future.
"These coming weeks will be important for us to work hard physically and technically so we can earn points and climb in the standings."
Milan are currently ninth in the Serie A table.