The striker has made five substitute appearances in the Premier League this season and last scored for the Toffees in May 2018.
Niasse arrives to boost Cardiff's battle against relegation, with Neil Warnock's side a point and a place above the bottom three.
"I'm really pleased to be at Cardiff City," the Senegal striker told the club's website after joining on a deal to the end of the season.
"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."
Cardiff is also being linked with a club-record move for Nantes striker Emiliano Sala.
Reports have indicated Cardiff is set to pay around £18million for the 28 year-old, who has scored 12 Ligue 1 goals this season.