The 39-year-old revealed in an interview with Sky Italia that he informed Pioli of his desire to leave San Siro in the close season to be closer to his family.
However, after initially accepting Ibrahimovic's choice, Pioli later managed to convince the ex-Sweden international to stay on at Milan and sign a 12-month extension.
"I told him I would call it a day, as I thought of the sacrifices and my family being in Sweden," Ibrahimovic recalled.
"Pioli told me: 'I respect that'. However, the next day, he called me again. [He said] 'I let you go too easy, but if you don't stay, it'll be a different team'. I went on vacation, but then I thought this is a fascinating and difficult challenge.
"I didn't want to hang up my boots feeling regret. So I called Mino [Raiola, his agent] and told him to close the deal."
Ibrahimovic has continued his fine form from the second half of last season into this term and Pioli is pleased he was able to talk the former Manchester United star into staying.
"With each player I try to be direct. When you speak from the heart you are more easily heard," Piolo said at a news conference previewing Sunday's trip to Sampdoria.
"I told him that, considering where we started this journey, it would not be the right time to interrupt it.
"I told him to think carefully and that me [Paolo] Maldini, Frederic [Massara] and [Ivan] Gazidis would do everything possible to convince him. We are happy he is here."
Ibrahimovic returned to Milan at the start of the year after two seasons with LA Galaxy and has scored 20 Serie A goals in that time.
Only Cristiano Ronaldo (29) and Ciro Immobile (25) have scored more in 2020 among Serie A stars, while Ibrahimovic's six assists is bettered by just 10 other players.
His haul includes a return of 11 goals in 10 league matches this term, including a brace in Milan's 3-1 win over Napoli last month before limping off with a hamstring injury that has kept him sidelined since.
That double saw him match Gunnar Nordahl for the second-most Serie A goals from the first eight games played of a season, only adrift of Marco Van Basten (12 in 1992-93).
Ibrahimovic is also the oldest player to net at least 10 goals in the first eight Serie A matchdays, but he has once again been ruled out of this weekend's clash with Sampdoria.
Norway international Jens Petter Hauge is one of those to have profited from Ibrahimovic's absence, the 21-year-old scoring twice in Milan's last four matches.
"He has important qualities and we are lucky to have him on the pitch," Pioli said of the youngster. "He can still grow a lot but he is very intelligent.
"We have other players in that position but the important thing is he is proving to be a useful option to the team."
Since Europe's top leagues resumed post-lockdown, Milan are one of two teams alongside Manchester City with five players to have scored at least five goals - Ibrahimovic (17), Franck Kessie, Hakan Calhanoglu, Rafael Leao (all six) and Ante Rebic (5).
Calhanoglu was also on target in Thursday's 4-2 win over Celtic in the Europa League, as was Brahim Diaz, and Pioli is considering using one or both of the pair in a false nine position.
"I use the players where they can express themselves best," he said. "Diaz and Calhanoglu are both attacking midfielders, with one preferring a right-of-centre position and the other centre left.
"Many times we have played with false nines, even when Ibra is available. The most important thing is that they both give us solutions between the lines and provide us with more depth in attack."