using a digitalpin to check for 5v on a wire

Simply connect the wire that you want to measure to a digital pin, and the grounds together. The you can do a digital.read. You may need to pull it low when the line is low but that depends on the source of the signal you are trying to measure?