A functionally graded composite NiAl-AlMg6 was prepared using the pressure of gaseous reaction products (impurity gases) produced during the synthesis of reactive powders in a sealed reactor. It has been shown that this method can be used to prepare a NiAl/AlMg6 composite with both chaotically oriented pores in the NiAl layer and unidirectionally oriented pores (lotus-type pores). The pore shape in NiAl was found to be dependent on the pressure of the impurity gases and hydrogen present in the starting titanium powder. A mechanism for pore formation in NiAl and AlMg6 composite during SHS is proposed. Thus, functionally graded high-temperature composites can be produced by SHS in a sealed reactor using the chemical reaction energy and the pressure of impurity gases and hydrogen. Additionally, minimizing the influence of impurity gases on the contact zone increases the interface area between NiAl and AlMg6.