We report low-temperature thermal expansion measurements on the tetragonal heavy-fermion superconductors CeMIn5 (M=Ir,Co) in magnetic fields up to 8 T which allow for the analysis of the uniaxial pressure effects on both normal-state and superconducting properties. Our study reveals that T(c) is strongly affected by at least two factors, the lattice anisotropy and the 4f-conduction-electron hybridization strength which is most sensitive to c-axis lattice distortions. Non-Fermi-liquid behavior caused by quantum-critical fluctuations is observed for both systems, most pronounced for CeCoIn5.