Kaka, 31, expressed a desire to leave the Spanish capital on Thursday after struggling to become a permanent member of Real's first team.
The Brazilian – who played for Milan between 2003 and 2009 – is reportedly keen on a return to the Serie A giants.
Galliani, who ruled out a potential return for the playmaker in June, confessed to being in talks with him on Friday.
Galliani also confirmed that Milan are trying to sign CSKA Moscow's Keisuke Honda and that both of them coming to the club would be unlikely.
"It is complicated at this time," Galliani told Milannews.it.
"We are closer to signing Keisuke Honda than Kaka and a deal for one would exclude the other."
Kaka – who cost Real a then-world record fee of €65million in 2009 – has made 120 appearances for the club in all competitions, scoring 19 goals.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.