It is not known when Ma Zhi was born. It is known that his family was from Fufeng, but nothing else was known about his ancestry other than that his father's name was Ma Xun — with the Old Book of Tang rendering his father's personal name as 曛 and the New Book of Tang rendering it as 勛 — with no connections to the families of the two other Tang chancellors surnamed Ma, Ma Sui and Ma Zhou. Ma Zhi passed the imperial examinations in the Jinshi class in 819, during the reign of Emperor Xianzong, and further passed a special imperial examinations for those who were capable in planning. He was thereafter made the deputy military prefect of Shou Prefecture. He thereafter served as Xiaoshu Lang, a copyeditor at the Palace Library, and yet later served as the prefect of Rao Prefecture.
During Emperor Wenzong's reign
Early in the Kaicheng era of Emperor Xianzong's grandson Emperor Wenzong, Ma Zhi was made the protector general of Annan. It was said that Ma, in addition to his literary abilities, was a capable administrator. In 838, he submitted a report in which he claimed that the nominal magistrate of Wulu County — under Tang's system of commissioning local tribal leaders with official titles — was faithful to Tang and was often giving good suggestions, and requested that Wulu County be upgraded to be a prefecture; Emperor Wenzong approved the request. It was also said that because of Ma's good governance, the tribal chiefs all sent their sons to serve as hostages and offered to pay tributes. Further, a pool at Wulu Prefecture that had previously produced pearls but were no longer doing so by Ma's time again began to produce pearls, which was viewed as a sign of divine approval. Ma was thereafter promoted to be the governor of Qianzhong Circuit.
During Emperor Wuzong's reign
During the middle of the Huichang era of Emperor Wenzong's brother Emperor Wuzong, Ma Zhi was recalled to the capital Chang'an to serve as the minister of palace supplies, and later became Dali Qing, the chief judge at the supreme court. However, neither of these posts carried great power, as Ma, despite a reputation for being capable, was not well regarded by then-leading chancellor Li Deyu. It was said that Ma thus bore resentment toward Li Deyu.
During Emperor Xuānzong's reign
In 846, Emperor Wuzong died and was succeeded by his uncle Emperor Xuānzong. Because Emperor Xuānzong despised Li Deyu for his hold on power, Li Deyu was almost immediately thereafter demoted and sent out of the capital, and Bai Minzhong became the leading chancellor. In 847, during a drought, which were often viewed as signs of divine displeasure over overly severe punishment, Emperor Xuānzong had the chancellor Lu Shang and the deputy chief imperial censor Feng Ao review the cases of the prisoners held at Chang'an. Lu and Feng apparently advocated for commutation of many death sentences. Ma objected and submitted a petition to Emperor Xuānzong arguing that that leniency would have the opposite effect of drawing further divine displeasure. It was said that because of efforts by Bai, who often promoted those people he felt slighted by Li Deyu, Ma's petition was accepted, and Lu was subsequently demoted. Ma was then made the deputy minister of justice as well the director of the salt and iron monopolies. In 848, Ma was made a chancellor de facto with the designation Tong Zhongshu Menxia Pingzhangshi. While serving as chancellor, Ma and Emperor Xuānzong's trusted eunuch Ma Yuanzhi, one of the two commanders of the Shence Armies, became close associates, as Ma Zhi endeared himself to Ma Yuanzhi based on their common surname. On one occasion in 850, Emperor Xuānzong gave Ma Yuanzhi a jewel-studded belt as an award, and Ma Yuanzhi in turn gave it to Ma Zhi. When Ma Zhi wore it to an imperial meeting, Emperor Xuānzong recognized it and immediately interrogated Ma Zhi about it. Ma Zhi did not dare to lie to the emperor, and Emperor Xuānzong, after learning what happened, was displeased about Ma Zhi's close association with Ma Yuanzhi. The next day, Emperor Xuānzong removed Ma Zhi from his chancellor post and made him the military governor of Tianping Circuit. After Ma's demotion, Emperor Xuānzong further had his assistant Dong Mou detained and interrogated. When Dong gave more details about the close association between Ma Zhi and Ma Yuanzhi, Emperor Xuānzong further demoted Ma Zhi to be the prefect of Chang Prefecture. Ma Zhi was later made an advisor to the Crown Prince, with his office at the eastern capital Luoyang. Several years later, he was made the military governor of Zhongwu Circuit and the prefect of its capital Xu Prefecture. Toward the end of Emperor Xuānzong's Dazhong era, he was made the military governor of Xuanwu Circuit and the prefect of its capital Bian Prefecture, and he died while serving there.