Sima Gui was born in 235 to Sima Fu during the reign of Cao Rui. At the time, both his father and uncle Sima Yi were officials of Cao Wei. Gui was also born late in Sima Fu's life, as Fu was about 55 years old and his eldest son Sima Wang was about 30 years older than Gui. The Sima clan's prominence grew in the aftermath of the Incident at the Gaoping Tombs in February 249, as Sima Yi became sole regent; Yi's sons Sima Shi and Sima Zhao were also regents of Cao Wei. During the Cao Wei era, Sima Gui was appointed Marquis of Gaoyang Village. After Sima Zhao reinstated the "five-rank peerage" system in 264, Gui's title became Viscount of Zhenyang.[6]
In September 265, Gui's cousin Sima Zhao died. A few months later, on 8 February 266,[7] Sima Zhao's son Sima Yan (posthumously known as Emperor Wu of Jin) usurped the throne from Cao Huan and founded the Jin dynasty. The next day, Sima Gui, his brothers, father and nephews Sima Hong (司马洪; father of Sima Wei) and Sima Mao were made princes. Gui's fiefdom consisted of 5570 households.[8]
On 10 April 271,[9] Emperor Wu appointed Wang Ye and Sima Gui as the Left and Right Supervisors of the Masters of Writing respectively.[10] As Supervisor of the Masters of Writing, Sima Gui once submitted a petition by Jia Chong against his political rival Ren Kai (任恺), accusing Ren of being extravagant. This caused Ren to be relieved of his post.[11]
Sima Gui died without issue in March 274, just less than two years after his father's death in April 272. Gui had an excellent reputation, and he was deeply missed by Emperor Wu.[12] The next day,[13] his elder brother the Prince of Taiyuan also died. Sima Ji (司马缉;[14] son of Gui's elder brother Sima Fu (司马辅) Prince of Bohai[15]) was appointed the next Prince of Gaoyang.[16]