It sounds like you're thinking of Gateway to Elsewhere (1954) by Murray Leinster. It was published as "Journey to Barkut" in a 1952 issue of Startling Stories, with cover art based on the story.
[Remainder Copied from this question]
The protagonist, Tony Gregg, has a gold coin which he considers to be a good luck charm. An inscription on the coin indicates it's from the apparently non-existent land of Barkut. Tony gets in the habit of flipping the coin to make small decisions, and one day it leads him to meet a man who recognizes the coin and tells Tony that it came from another world.
Tony figures the coin wants to go home, so he uses coin flips to guide himself on a long journey which eventually leads back to Barkut. He learns that Barkut is inhabited by men and Djinn, who are at odds with each other. He has further adventures with the Djinn.
Gateway was reprinted in the 2005 collection A Logic Named Joe. Google Books has a page for Logic which lets you view parts of the book. I have an electronic copy of Logic which I think I downloaded from the Baen Free Library, but it's not available for download there at the moment.
Baen also distributed CDs with electronic copies of their books. The CDs are apparently freely distributable, and I was able to find a site with several CDs for download. Logic appears to be available on some of the CDs. Some googling should lead you to other sites where the CDs and their contents can be downloaded.
Edit: @sean-duggan found a complete copy of A Logic Named Joe freely accessible in HTML form on Baen's websubscriptions site. Gateway to Elsewhere is included.