It is permissible for the One praying alone to break off His Prayer in order to pray with the Congregation
Question :
If a person was performing an obligatory prayer alone and while he was doing so, a number of people entered the mosque, made the Takbir and began to pray in congregation. Should he break off his prayer, or make his intention to pray a non-obligatory prayer, so that he might pray with them?
Answer:
It is better to make it a non-obligatory prayer and then pray with those who have started the congregational prayer, in order to attain the reward of the congregation. If he breaks it off, there is no sin in that, because he is breaking it off for some lawful benefit which returns to the same prayer. And through Allah is attained success.
Source:
Ibn Baz
Fatawa Islamiyah, Vol. 2 Pages 395-396