The Lord’s teaching in Matthew 5. 23-24 is usually taken to mean that gifts offered to God are not acceptable to Him if things are not right between the offerer and his brethren. However, the context in which this saying is found suggests a slightly different interpretation.
The saying follows straight on from the Lord’s condemnation of anger and abusive language. Both angry feelings and expressions of contempt, He warned, render the offender liable to severe judgment, vv. 21-22. It is at this point that He added, “therefore if thou bring … “.
I suggest that the complete section can be paraphrased as follows;
"You have been taught that murder is a serious matter and merits judgment. I say to you that, in the sight of God, anger (of which murder is but the ultimate expression) is a serious matter and merits judgment also”, w. 21-22.
"It may be that, having brought your gift to God’s altar, you there remember that you have given your brother cause to bear ill-will towards you: he ‘hath ought against thee’. For his sake and without delay, you must eliminate the provocation which you gave him earlier. Notwithstanding the fact that you are in the very process of offering a gift to God, you must go immediately and sort things out with your offended brother: you must 'first be reconciled’ to him’, vv. 23-24.
"When you are in the wrong, it is essential (for your own sake this time) for you to put things right with ‘your adversary’ – before it is too late”, vv. 25-26.
For one person to nurse a grievance against another is an extremely serious matter. So much so that to remove your brother’s sense of grievance is more important even than to offer a gift to God!