Marsh was ruled out of the closing stages of the World Cup with a fractured forearm, suffered while batting in the nets against Pat Cummins, and the club hope he will be available for the final six group games.
Zaman underwhelmed in the World Cup with 186 runs in eight innings, and only one score above 50, but has an impressive T20 record. He was Lahore Qalandars' leading run-scorer in an otherwise underwhelming PSL campaign this year.
The move will be Zaman's first stint in county cricket, though he briefly signed for Somerset in 2017 only to be recalled by the PCB for a training camp the day before he was due to fly to the UK.
Glamorgan will start their Blast campaign with only one overseas player, with their other signing - Mitchell Marsh - part of Australia's 25-man preliminary squad for the Ashes, though Colin Ingram rejoins on a Kolpak deal as captain.
Zaman holds fond memories of playing at Cardiff, which date back to his debut tournament for Pakistan, the 2017 Champions Trophy. Then, he made 57 off 58 in a partnership of 118 in their semi-final victory against England at the ground, the game before his memorable century in the final against India.
Glamorgan's director of cricket, Mark Wallace, said: "It is disappointing to lose Shaun Marsh for the start of the competition but to secure the services of Fakhar on short notice is great news for the club. He is a fantastic cricketer and one of the most destructive batsmen in the world who has a history of performing in big matches."
Glamorgan start their campaign on Thursday night against Somerset, before travelling to play Gloucestershire at Cheltenham the following afternoon.