For me, it directly depends on the cost they would charge me. Some gyms are reasonable and have like a $5 drop in fee, especially if you can show an out of town ID.
Others, are completely absurd and have like $20 day passes to discourage locals from doing cheap day passes instead of memberships.
I’ll happily pay the $5 pass, or even possibly $10.. I’d gladly abuse the heck out of the trial pass system for those $20 day pass places that aren’t willing to help out of towners.
If you find a small privately owned gym, you are much more likely to get them to work a deal if you explain your situation. Maybe ask for a $20 week pass or something. My wife and I were visiting family this past Christmas and the local gym was happy to let us lift for free.