As I understand the Federal law- (and I am NOT a lawyer)
If you acquire a firearm from a resident of another state- and they are not a FFL holder (dealer) it needs to be transferred to you thru a dealer in your home state. That includes sales, gifts, trades, barter, and being given a gun to pay off a debt. ANY transfer of ownership of the gun.
The ONLY exception in Federal law is INHERITING a firearm. the Executor of an estate can give or ship a firearm to the recipient without a dealer. State law will vary.
Here is the law: http://codes.lp.findlaw.com/uscode/18/I/44/922
very long read.