Zielinski had joined Napoli in 2016, and was one of then-manager's Luciano Spalletti's key players as the club secured the championship in the 2022-23 season, their first in 33 years.
"Class, character and plenty of experience in Serie A: Piotr Zielinski, the first Polish player in Inter's history, is ready to display all his quality in Nerazzurri colours," Inter said in a statement.
Zielinski moved to Italy from Poland at 17 to join the youth academy of Udinese, for whom he made his Serie A debut in November 2012.
He then spent two seasons on loan at Empoli in 2014-2016.
Zielinski made his Poland debut in June 2013, in a friendly against Liechtenstein.
He has scored 12 goals in 93 games for his national side, representing Poland at three European Championships, including the current tournament in Germany, and two World Cups.