Having worked on a lot of iPhones, I can't think of any part of the phone that could fall out of a charging port. Does the phone still charge? Because anything from the phone itself that came out of there would have to be part of the port itself, in which case I doubt you'd still be able to charge it.
However, my best guess here is that it's the broken off tip of a charging cord. If you compare that square with the end of a good cord (the part that actually inserts into the phone), I'm betting it'll look the same. If that's the case, somewhere out there is a cord missing its end, may it rest in pieces.