If it’s an iPhone, you might be able to get contact info by tapping “emergency” on the lock screen. then “medical id.” If the owner has set up an emerceny contact, their name and number will be displayed there.
Some Android devices offer similar functionality too, but I don’t know how it works.