Borussia Dortmund secured second place after coming from behind to beat Eintracht Frankfurt 3-2 in an emotion-filled Signal Iduna Park farewell.