Do you need first authorship to use a publication for your PhD thesis?
Authorship issues within a group should be resolved by supervisors. This is easily found out by a simple web search or by simply asking lab members. It’s probably on your university’s website.
Authorship order can include two lead authors. This can be explicit (ie written in the submission notes) or implicit (by authorship order conventions in your community).
However, from what you describe your coauthor is abusing their position, or just given a lot of authority by the PI. If any of my students threatened a labmate they’d be in trouble. Ultimately the supervisor should decide material access, and more. Indeed, as you say - since two funding agencies are involved the two supervisors (yours and theirs) should be involved if only to agree whose grant the paper goes on.
Finally, this has nothing to do with thesis work. You can definitely include coauthored work in a thesis, with the express permission of your coauthors. I ‘donated’ a nice figure to a coauthor’s thesis and was happy to do it!