Valmiki Ramayana Kishkindha Kanda Sarga 22 Shloka 17
Original Shlokaइत्येवमुक्तस्सुग्रीवो वालिना भ्रातृसौहृदात्। हर्षं त्यक्त्वा पुनर्दीनो ग्रहग्रस्त इवोडुराट्4.22.17।।
1 source checked for this shloka
वालिना by Vali, भ्रातृसौहृदात् due to brotherly affection, इत्येवम् thus, उक्तः spoken, सुग्रीवः Sugriva, हर्षम् happiness, त्यक्त्वा having given up , पुनः again, दीनः dull, ग्रहग्रस्तः eclipsed by planet Rahu, उडुराट् इव like the Moon.
Thus spoken to by Vali with brotherly affection, Sugriva gave up joy (of victory) and appeared dull like the Moon eclipsed by planet Rahu.