The Kidd Creole -- a rap pioneer from Grandmaster Flash and the Furious Five -- has been arrested and charged for the stabbing death of a homeless man.

Law enforcement sources tell TMZ ... the rapper used a small knife to stab the man 2 times in the chest and once in the head Tuesday night in Midtown. The man allegedly called Kidd Creole a gay slur.

The homeless man -- identified as 55-year-old John Jolly -- died at Bellevue Hospital.

Cops say the 57-year-old rapper was taken into custody Wednesday. They used surveillance footage to identify Creole, and believe his motive was an angry reaction to the gay slur.