Given that there is no authorized let alone funded NASA program SpaceX will obviously get there there first with a human crew.Of course NASA isn't stupid and as soon as SpaceX starts prepping the first flight NASA will pay to have their astronauts go along. In addition the astronauts will be the first ones on the surface.
But will Orion or Starship take people to Mars?
Will NASA or SpaceX get to Mars first?
As has been stated above it will be a joint effort by NASA, SpaceX, and other commercial and international partners IMO.
I know there are some here who have this pipe dream that SpaceX will go it alone and thus give a giant you-know-what to NASA because such persons hate NASA for some reason.
Truth is SpaceX and NASA have been getting along great for a long time now. It is only natural that they will be partners on this endeavor. What exact form that partnership will take on a mission to Mars I don't know.
I do think though that NASA will be the "lead" or "facilitator" in a very similar way to what is happening now with Artemis (specifically HLS, Gateway, CLIPS, etc.).
And if SpaceX didn't partner with NASA that would NOT be SpaceX giving NASA the finger, since NASA doesn't determine what it does, NASA works for the President and is funded by Congress, so if those two entities don't care about Mars, then NASA isn't going to Mars. So if SpaceX goes to Mars without NASA, it won't be because of SpaceX.It is true that SpaceX and NASA have a GREAT working relationship. And SpaceX understands that NASA is a customer that offers a lot of benefits. But I also think that NASA knows that Elon Musk built SpaceX to colonize Mars, and they will understand if SpaceX decides to not partner with NASA on that endeavor.The reality is that SpaceX is leading the drive to Mars, and NASA is likely to come along as a minor partner, giving the U.S. Government bragging rights, but not enough influence to slow down what SpaceX is doing.