Is it possible to update Gitlab commit status if Jenkins job is not triggered from the Gitlab?

We have the following configuration: The Jenkins pipeline is located in the Gitlab, but the trigger for this pipeline is coming from an external script and not from the Gitlab. We want to update a specific commit in the Gitlab once the pipeline is ended. Can it be done with updateGitlabCommitStatus or gitlabCommitStatus groovy command? Thanks.