The 38-year-old, possibly playing the final match of his second stint at the club, took his tally to 10 league goals since returning in January and became the oldest player to score 10 or more goals in a Serie A season.
The Swede's contract ended with Saturday's match although he could extend it into next season according to some Italian media reports.
AC Milan went ahead with an own goal by Ragnar Klavan in the 11th minute. Rafael Leao hit the post from a narrow angle but the ball bounced off the Estonian defender and into the net.
Ibrahimovic made amends when he scored with an emphatic finish from Samu Castillejo's pass in the 55th minute, and Castillejo exchanged passes with Giacoma Bonaventura to score the third two minutes later.
Milan, unbeaten since the season restarted in June, finished sixth with 66 points and will play in the Europa League qualifying rounds next season.