it all depends on the song. some songs have a definitive bassline. if it does it usually repeats and if there's no bass player usually the organist or keyboardist is holding it down until you catch on and start playing that pattern. if there is no definitive bassline, but rather structured progressions, which ALSO repeat, you can listen in and the 2nd or 3rd go, you should have it down for the most part (unless its a Richard Smallwood song, which seemingly takes forever to repeat). With the progressions, you can fill in in-between, but listening to the other musicians will be important to determine your groove and flow. You cant be in left field while the others are somewhere else.
the more experienced you get, you can find your way quicker, and can better judge what works and doesnt in the context of the song. For me, with some songs i can catch the pattern, but it takes me a good while to get the key. other times it can be harder to catch the pattern when the keyboardist/organist is super busy and throwing in extra chord changes, which differs during each go 'round.
Seemingly from what i've experienced, the gospel realm is the only one that throws u in these kinds of situations beyond rehearsals and jams/sheds.