From the library website: Eligibility Library cards can be obtained in person at any Mesa Public Library location. Anyone who lives in Maricopa County for at least 30 consecutive days a year or who works, owns property, or attends school within the County is eligible for a free Mesa Public Library card. If you do not meet the requirements for a free card, you may register for a card for an annual fee of $40. Requirements You'll need to present a valid photo ID to get a library card. If your photo ID does not reflect your current address, you'll also need to bring a form of address verification. You may be issued a library card without proof of address, however, you'll be asked to bring one in on your next visit. Acceptable forms of address verification may include a recent, postmarked piece of mail, vehicle or voter registration, utility bill,or any legal document with the current address.
You can get a library card if you are not an Arizonan for 40$/year.
I'm pretty sure you can use it beacause you just walk inside and do whatever, but you'll need a card for check out and I don't know how getting that works if you aren't a resident.
You could do certain services but would need a library card from them in order to check anything out.
Thanks! Your answer is awaiting moderation.