What is the simplest and best device (or circuit) to stop the flow of current in a line when current in another line is present?
You can use a basic diode switch like this:



When 5 V is present, no current will flow from the 3.7 V source.