The crystal structures of poly[bis(4-methylanilinium) [tetra-μ3-oxido-hexa-μ2-oxido-hexaoxidopentamolybdenum(VI)]], {(C7H10N)2[Mo5O16]}n, (I), and poly[bis(4-iodoanilinium) [tetra-μ3-oxido-hexa-μ2-oxido-hexaoxidopentamolybdenum(VI)]], {(C6H7IN)2[Mo5O16]}n, (II), were determined from laboratory X-ray powder diffraction data using the direct-space parallel-tempering approach and refined by total energy minimization in the solid state. Both compounds adopt layered structures, in which layers of the inorganic {[Mo5O16](2-)}n polyanion alternate with layers of the organoammonium cations parallel to the (100) plane. The asymmetric units contain three Mo atoms (one situated on a twofold axis, Wyckoff position 4e), eight O atoms and one organic cation. Despite the fact that the structure determinations are based on powder diffraction data, due to the total energy minimization approach applied the Mo-O bond lengths can formally be assigned to one of the three groups, reflecting different types of O-atom placement within the polyanion. The cations form relatively strong N-H...O hydrogen bonds, anchoring one end of the organic molecules to both terminal and shared O atoms. The interactions involving the opposite end of the benzene rings are much weaker and include C-H...O and C-H...π bonds in (I) and an I...O halogen bond in (II). Mutual rotation of the benzene rings in both structures leads to the formation of a C-H...H-C dihydrogen bond, with H-atom separations of 1.95 Å in (I) and 2.12 Å in (II). Differential scanning calorimetry measurements show that the interactions between the inorganic and organic layers are stronger in (I) than in (II).