The Rossoneri were 3-0 down at the Stadio Comunale Via del Mare at the break but substitute Kevin-Prince Boateng inspired Milan to a thrilling win with a second-half hat-trick for the visitors.
Yepes too got on the scoresheet - the winning goal in the 83rd minute as Massimiliano Allegri's side managed to move up to seventh in the table when they were facing the prospect of dropping as low as 16th at the interval.
"I'm very happy," Yepes told Milan's official website.
"It's my first goal for the club.
"We couldn't have imagined a game this tough. We did well because we managed to turn the result around from a 3-0 loss to a win.
"We showed personality and the ability to react. We got three important points."
Milan host Parma at the San Siro on Wednesday in their next Serie A game.