In this paper, it is proved that the complement of the zero-divisor graph of a partially ordered set is weakly perfect if it has finite clique number, completely answering the question raised by Joshi and Khiste [‘Complement of the zero divisor graph of a lattice’, Bull. Aust. Math. Soc. 89 (2014), 177–190]. As a consequence, the intersection graph of an intersection-closed family of nonempty subsets of a set is weakly perfect if it has finite clique number. These results are applied to annihilating-ideal graphs and intersection graphs of submodules.