Jelly, 6 bytes
ṀŻ‘ḟ³Ṃ
Explanation
ṀŻ‘ḟ³Ṃ # | [-1, 0, 1, 4]
Ṁ # Maximum | 4
Ż # Range from 0 | [0, 1, 2, 3, 4]
‘ # Increment | [1, 2, 3, 4, 5]
ḟ # Filter out items |
³ # In the input | [2, 3, 5]
Ṃ # Minimum | 2