Bastardo, 30, has 46 strikeouts and a 4.74 ERA in 41 relief appearances this season. Last season for the Pirates, Bastardo was 4-1 with a 2.98 ERA in 66 appearances.
He signed a two-year, $12 million deal in the offseason with the Mets.
Niese is 8-6 with a 4.91 ERA this season. He was acquired by the Pirates from the Mets in the offseason for second baseman Neil Walker.