Update SparsityPattern using global numbering of DOFs

Is it possible to insert in a SparsityPattern using global DOFs? I have interactions between DOFs of 2 different meshes that belong to different processors and are not ghosted. Processors have triplets of contributions (global row, global col, val) to be added to the matrix where the global row is either local or ghosted but the global col does not need to be neither local nor ghosted.

If not, how would you go about pre-allocating a PETSc matrix knowing which pairs of global DOFs have entries?