I think that the common pronunciation of muslim with /z/ does indicate that there is likely some analogy going on with words like muslin or gosling. The l doesn't "cause" /z/ in the sense of a requirement or sound rule, as the pronunciations of Muslim with /sl/ and /zl/ both exist and contrast with each other.
The pronunciation of the letter S as /s/ or /z/ doesn't follow very predictable rules.
/zl/ only occurs between syllables (as /z.l/), never at the start of a syllable
The sound preceding the S is definitely relevant. When "sl" occurs at the start of a word in English, the "s" is always pronounced as a voiceless fricative. The same applies to "sl" in the middle of a word when it is interpreted as the start of a syllable (or where it is originally word-initial), as in bobsled, mudslide, payslip, asleep.
The pronunciation of "sl" as /zl/ only occurs as far as I know in contexts where the consonants can be interpreted as belonging to separate syllables, as in/ˈgɑz.lɪŋ/. So it has to be preceded by a sound that can come before syllable-final /z/—which means a voiced sound (either a vowel sound or a voiced consonant sound).
To be clear, there are (non-native) words spelled with "zl" that you can hear pronounced with syllable-initial /zl/, such as zloty. So syllable-initial /zl/ isn't absolutely impossible for English speakers to pronounce; it just isn't a possible pronunciation at the start of a syllable spelled with "sl".
But /s.l/ is also possible between syllables
We can see that "s" doesn't always represent /z/ when followed by /l/ in a separate syllable. Compound words are a clear counterexample: gaslamp and gaslight have /s.l/ rather than /z.l/.
Additionally, words with the suffixes -less or -ly don't show voicing. With -ly, the many words ending in -ously show this. Most -less examples are spelled with "ssl", but there are also rare examples like gasless or focusless that show that this applies regardless of the spelling with one or two Ss.
some words currently or historically show variation between /z.l/ and /s.l/
Variation between /z.l/ and /s.l/ seems to be particularly common with prefixed words. The commenters have mentioned the trans-prefixed word translate.
Some words starting with dis- are pronounced with /dɪs/ and some with /dɪz/ (e.g. disease, disaster). Words where dis- is followed by a consonant are typically pronounced with /dɪs/ in contemporary English. However, there is evidence that some speakers have used voiced /dɪz/ before l in words like dislike, dislodge. That pronunciation is given in John Walker's Critical Pronouncing Dictionary of 1823 (§435); the fact that Walker feels the need to say that these words "ought" to be pronounced with a /z/ sound suggests that he also was familiar with pronunciations of these words starting with /dɪsl/.
Comparison: voiced S before other consonants
Other spelling patterns that you might compare this to are sn (as in Disney) sm (as in cosmic), and more rarely, sr (Israel) or sb (husband). As with sl, word-initial or syllable-initial sn or sm always have a voiceless fricative; /zn/ and /zm/ are only possible across syllables. The productive suffix -ness does not trigger voicing of preceding /s/, so we have /sn/ in consciousness, righteousness, etc.
Syllable-initial sr and sb do not exist within the basic English sound system, although they can be found in recently loaned words or proper nouns like Sri Lanka or Sbarro that are pronounced in various ways.