Niasse has scored 12 goals in 49 Premier League appearances since arriving at Goodison Park from Lokomotiv Moscow in January 2016.
The 28-year-old Senegal international, who scored four PL goals during a loan spell with Hull City in 2016/17, has made five appearances for Everton this season.
"I’m really pleased to be at Cardiff City," Niasse, who will wear the No 29 shirt, told Cardiff City TV.
"Having heard about the manager from other players and met him earlier today, I knew this was the right move for me. Other clubs were interested, but I was convinced that this was where I wanted to come."