Assume that your planet-moon system is actually a double planet system.
Assume that both planets are the same size. Obviously if one of the identical planets has sufficient gravity and magnetic field to retain a dense atmosphere, the other identical planet will also have sufficient gravity and magnetic field to retain a dense atmosphere, though not necessarily of the same density and composition as the other planet.
Then reduce the size of one of the twin planets down to an asteroid one mile in diameter. Obviously such a tiny asteroid will not have either sufficient gravity or magnetic field and can't possibly retain a dense atmosphere.
So try intermediate sized objects as the moon or companion planet of the Earth like planet.
It seems pretty obvious that an object the size of the Moon in the habitable zone of its star would not retain a noticeable atmosphere, since the Moon is in the habitable zone of its star and does not retain a noticeable atmosphere. And calculations shows that if the Moon was given an atmosphere like earth's it would dissipate into space in only 1,000 years - unless it could somehow be contained by an atmosphere holding force field or a roof around the entire Moon or something else science fictional.
Titan does retain a dense atmosphere, denser than Earth's, but would have a harder time retaining one if it was in the habitable zone of a star and thus had much hotter and faster gases in the escape layer of its atmosphere. And calculations show that Titan cannot retain its present atmosphere for as long as Titan has existed, therefore the present atmosphere of Titan should be either much younger than Titan or else should be constantly renewed by more gases from Titan at about the same rate that gases escape from the atmosphere.
Mars is much large than Titan and has a much greater ability to retain an atmosphere. But it's atmosphere is much thinner than Earth's or Titan's. It is believed that most of the original Martian atmosphere has escaped into space or chemically bonded with surface rocks. Thus it is possible that an object in the habitable zone of a star might have to be significantly larger than Mars to retain a dense atmosphere similar to Earth's.
Venus is only slightly smaller than Earth and thus has a slightly smaller ability to retain an atmosphere. But the atmosphere of Venus is many times as dense as Earth's atmosphere because for various reasons Venus has produced a much denser atmosphere than Earth did. Clearly a Venus-sized planet, or one significantly smaller than Venus, could retain an atmosphere with the same density as Earth's.
Many people would suggest that a planet in the habitable zone of its star would have to be somewhere between the size of Mars and the size of Venus in order to retain an atmosphere with the density of Earth's atmosphere.
Thus your planet-moon system will tend to resemble a double planet more than it resembles the Earth and the Moon - and some people have suggested that the earth and the Moon already count as a double planet.
It is possible that if your "moon" has an atmosphere of heavier gases, it could retain a dense atmosphere of those heavy gases while being smaller and having a lower escape velocity than necessary to retain an Earth-like atmosphere. And, like Titan, the "moon" might emit gases at a fast rate to replace the gases that escape from the atmosphere.
Since your planet-moon pair will have a "moon" probably much larger than the Moon, one way to keep it from looking like a double planet would be to make the Earth equivalent world a bit bigger than Earth. But there may be limits in your story as to how much larger you can make it. If humans are going to walk on the surface of the planet, the surface gravity should be less than about 1.25 that of Earth, for example.
So possibly you might want to describe it as double planet instead of a planet and a moon.
See answers to this question:
Reality Check: Habitable moon around earth-like planet1
Also see the graph in L.Dutch's answer to this question:
Asteroids with an atmosphere2