IANAL but IIRC a gun can be gifted to you, or loaned or bought via a secondary sale. No FFL involved
Handguns are "regulated firearms" under MD law, and ALL sale/transfers of "regulated firearm" must go through an FFL or be handled by the MSP directly and be subject to MSP "not denying" them. (In MD, the MSP does not "approve" ANYONE buying firearms, you are either "denied" or "not denied", which is, philosophically, linguistically, legally, and morally VERY different from "approved"...)
"Secondary Sales" of "regulated firearms" MUST go through an MSP background check--and for most folks it's easier to have an FFL do it. So technically, you don't HAVE to use an FFL for a secondary sale, but it's about a million times easier, and you'll get a LOT less hassle about it than if you try to geal directly with MSP.
Either way, though, MSP has to get their grubby paws on the process, and you are subject to their "background check" system, a 7-day waiting period, and they will register and record the sale in their "regulated firearms" database.
Reason 3,057 why Maryland sucks...