When purchased from Apple, the purchaser will receive a printed invoice with the device serial number and description. The invoice will state if the device is renewed/refurbished. As you will presumably receive this invoice along the with iPad that was purchased by your friend’s neighbour, you can easily verify that you have received the iPad that was purchased.
If not purchased directly from Apple, either a physical store or the online Apple Store, you might not have similar confidence in the paperwork being so easy to marry with the device.
Assuming that you trust your friend - and your friend trusts his neighbour - you would hope to have little or no cause for concern. Either way, being so remote from the purchasing process - with no opportunity for return - what can you hope to achieve in questioning the provenance of the purchase made via a friend?