The NIT started in 1938 and the NCAA started in 1939. From what I’ve read, the first few years the NIT was definitely preferred, as there was more money involved and they played at Madison Square Garden.
The NCAA caught up a bit money-wise and started also playing at MSG in 1943. I’ve seen different arguments about the tourneys’ prestige levels in the mid-late 40s, but I don’t think the difference was as big as some people think (Either way, Utah also won the NIT in 1947 over Kentucky).
Starting in the 1950’s, the NCAA required the top 10 conference champs to play in the NCAA tourney, and the NCAA slowly pulled away from the NIT over the next couple of decades. The NIT was still pretty prestigious into the 1970s.