Stargate SG-1: The Price You Pay

Unable to make them allies in the ongoing war, they then find themselves stranded on the planet, with the Goa'uld about to come for the next tribute.
The author gets the characters just right, but the action doesn't start until nearly the end of the book, so there's lots of conversations about why the locals do what they do and being told that's wrong by O'Neill et al.