No. "You Are Not Alone" was released as a single on August 18, 1995 (music video premiered on MTV that day). Princess Diana died on August 31, 1997—nearly two years later.
While Michael Jackson and Diana were friends (they met several times; he dedicated "Dirty Diana" to her at Wembley), the song was written by R. Kelly for Jackson's HIStory album, not for Diana's funeral. The timeline makes the claim impossible.