Ben Sira 22:23

23 Gain the confidence of your neighbor if he is poor; then you can share his happiness if he becomes successful. Stand by him when he is in trouble if you want to share with him when better times come his way.

Ben Sira 22:23 In-Context

21 Even if you have a violent argument with a friend, and speak sharply, all is not lost. You can still make up with him. But any friend will leave you if you insult him, if you are arrogant, if you reveal his secrets, or if you turn on him unexpectedly.
23 Gain the confidence of your neighbor if he is poor; then you can share his happiness if he becomes successful. Stand by him when he is in trouble if you want to share with him when better times come his way.
24 Fumes and smoke appear before the flames do; insults come before violence.
25 I will never be afraid to protect a friend, and I will never turn a friend away if he needs me.
Scripture taken from the Good News Translation - Second Edition, Copyright 1992 by American Bible Society. Used by Permission.