Just as people can go for quite a while driving without a license before they get caught, there is no certain way to catch somebody who goes flying without a license. There are various ways that it can happen, but none of them are certain.
There was a quip quoted elsewhere referring to the high proportion of unlicensed pilots in Alaska, that supposedly the FAA had a goal of getting at least half of them licensed. I have no idea how much, if any, truth is behind that statement.
On the other hand, just as having a license can make various things you might do with a car easier or possible, there are plenty of instances where having a pilot license is necessary:
- Renting a plane
- Buying insurance for a plane you own (without a convincing story of who else would be flying it, at least)
- A "ramp check" by an FAA inspector
- Getting a job (from a reputable company, at least) as a pilot
If you file a flight plan for your flight (required for IFR -- mostly, not required but very highly recommended for VFR), part of that is to provide a name for the pilot. But that's it, just a name, not a license number. (Phone number, yes -- so they have somebody to call in case you're overdue so they can see if you simply forgot to close your flight plan.) I don't know how often that info would be checked against any database of current pilots, but the potential would be there. But the ways the FBI would find people in an investigation is wildly different from what's routinely done by Flight Service.
So if Farmer Joe (licensed) owns an airplane & his (unlicensed) brother Fred flies it every now and then from their private dirt strip, the chances of Fred getting caught are probably pretty slight, unless something goes pretty badly wrong. And, depending on Joe and Fred's tolerance for risk, they might be entirely okay with that scenario.
Me personally, there's no *%#@ing way I'd be party to any such arrangement, but I'm probably more cautious than some Alaska bush pilots that way! This thread discusses the consequences for flying without a license.