The earliest I found is from 1994's Floundering
During the Floundering (credits, the cast sings along in a
rendition of "Nothing Funny 'Bout
Peace, Love and Understanding," as the
camera pans through the crowd.
This sort of thing is less incongruous with light comedies. There's Something About Mary (1998) is the first non-musical comedy I found with a cast singalong is probably the main influence for some later similar films.
Some later end credits cast songs:
Balls of Fury (2007) features a cast sing-along of Def Leppard's "Pour
Some Sugar on Me"
Slumdog Millionaire (2008): "Several of the cast perform a
traditional Bollywood song and dance
number set in a train station over the
"Frothy and crowd-pleasing, "You Again" (2010) concludes, as all such movies do, with a cast sing-along during the end credits. Most of the time it feels forced, but not here. The clearly great time being had by all as they take to the stage is infectious."
Of course, musicals such as Grease (1978) have had cast songs during the credits and may also be an influence.
Some other noteworthy earlier credits songs:
Austin Powers: International Man of
Mystery (1997) has Austin singing "BBC1" in a band during the credits.
Some episodes of The Muppets TV show ended with cast singalongs, for example from 1976: "Harry Belafonte: The cast sing the song "Turn the World Around"
while the end credits roll. Spike Milligan: The cast sing the song "It's a Small World" while
the end credits sing. Guest Spike Milligan tells them to keep quiet as he's trying to sleep."