Dallas sent San Jose its seventh-round selection (193th overall) in Saturday's draft. Niemi is set to become an unrestricted free agent Wednesday.
Niemi won all 16 postseason games for Chicago in 2010 when the Blackhawks won the Stanley Cup title. He went to San Jose as a free agent after that season.
The 31-year-old Niemi, who is from Finland, has a 190-100-40 regular-season record with a 2.39 goals against average in his NHL career with Chicago (2008-10) and San Jose (2010-15). He was part of Finland's bronze medal-winning team at the 2014 Olympics.