Niskanen was part of the Capitals' run to a Stanley Cup title in 2018, but his productivity dipped last season, as he had his fewest points (25) since 2012-13 while his per-game time on ice was his lowest in five seasons in Washington.
"We would like to thank Matt for all of his contributions to our organization for the past five seasons," general manager Brian MacLellan said in a statement. "Matt is a consummate professional and was a big part of our success. We wish him and his family all the best moving forward."
Gudas reached 20 points for the third time in seven NHL seasons. MacLellan complimented the 29-year-old on his "competitive, physical game."
The trade also gives the Capitals some salary-cap relief. Washington will take on $2.345 million of Gudas' $3.35 million for 2019-20, after which he will be a free agent. Niskanen is under contract for two more seasons at an average annual value of $5.75 million.
The Capitals have a number of free-agent decisions to address this offseason, including winger Brett Connolly.