By known descent alone, there would only be Dírhael grandfather of Aragorn.
The only known (male) person to have his ancestry to a near King explicitly described would be Dírhael, grandfather of Aragorn (explained below). Faramir and Imrahil are of high lineage, yes, but they are not stated to have been of the line of the Kings. For the purpose of clarity I will still add them into this answer.
Candidates through known descent:
Dírhael grandfather of Aragorn
He is one of the northern kindred of the Gondorians, being descended from a Chieftain of the Dúnedain in Arnor.
He is noted here to be the only person to have been explicitly described as an ancestor of the royal line. Faramir and Imrahil are never stated to have been of the line of the Kings- just that they are of high lineages.
He is noted to have been descended from Aranarth:
His son Arathorn sought in marriage Gilraen the Fair, daughter of Dirhael, who was himself a descendant of Aranarth.
This would make him of a high lineage, but being a descendant of the Kings of Arnor, he wouldn't have as much popular support with the people of Gondor as compared to the first 3 candidates I have mentioned. This is a completely similar case with his ancestor Arvedui the Last King; he was rejected the Crown of Gondor because he wasn't popular.
Unfortunately, it is never stated whether or not he was still alive by the War of the Ring. However, we can safely say that he would be around 170-200 years old by that time.
As mentioned, in terms of lineage, there are other candidates.
Other possible candidates:
First and foremost, we have;
Faramir, Steward of Gondor
The most likely candidate to be able to claim the crown. Why?
He is of a high lineage- he was descended, and so were the Stewards before him, from Húrin the Steward.
[...] they were descendants of the Steward of King Minardil (1621-34), Húrin of Emyn Arnen, a man of high Númenórean race.
He is well-liked by the people of Gondor. He became the Heir of Denethor after the death of Boromir, and was valiant in battle and loved by his men.
'The road may pass, but they shall not! Not while Faramir is Captain. He leads now in all perilous ventures. But his life is charmed, or fate spares him for some other end.'
'Faramir! Faramir!' men cried, weeping in the streets.
One could say, if Aragorn had died at the Morannon, Faramir would have been known as the 'Lord of Gondor' because of his role as the Steward, and we know that the Stewards technically 'exercise all the power of the Kings', so in a way he would be an unofficial King, similar to his ancestors.
Eventually though (same scenario involving Aragorn's death), the people of Gondor would have to accept that the King would return not, and eventually make the current Steward the King.
'How many hundreds of years needs it to make a steward a king, if the king returns not?' he asked. 'Few years, maybe, in places of less royalty,' my father answered. 'In Gondor ten thousand years would not suffice.'
Prince Imrahil of Dol Amroth
He would be the second most likely person to have been made King. Why (and why not)?
He is of high lineage- he was descended from Imrazôr the Númenórean, who is rumored to have wedded an elf-maid. This would give him some 'elven-blood': noted by Legolas;
At length they came to the Prince Imrahil, and Legolas looked at him and bowed low; for he saw that here indeed was one who had elven-blood in his veins. 'Hail, lord!' he said. 'It is long since the people of Nimrodel left the woodlands of Lorien, and yet still one may see that not all sailed from Amroth's haven west over water.'
In the tradition of his house Angellimar was the twentieth in unbroken descent from Galador, first Lord of Dol Amroth. According to the same traditions Galador was the son of the Imrazôr the Númenórean, who dwelt in Belfalas, and the Elven-lady Mithrellas.
He is well-liked by the people of Gondor. He is the brother-in-law of Denethor, last Steward of Minas Tirith, and is accounted for as one of the 'Captains of the West' and a 'Lord of Gondor' in the chapter: The Black Gate Opens.
Ever and anon Gandalf let blow the trumpets, and the heralds would cry: 'The Lords of Gondor are come! Let all leave this land or yield it up!'
He would be placed second after Faramir to the Kingship because:
- He did not hold the overlordship of Gondor1, unlike Faramir
- He dwelt mostly in Dol Amroth, and was not a 'local' resident in Minas Tirith like Faramir
Dúnedain of the South
It is possible that some Dúnedain are descendants from Elendil himself, given the fanaticism of 'pure-bloodness' in Gondor. 2 known Dúnedain of the South mentioned in The Lord of the Rings are the characters: Damrod, Anborn and Mablung (not the Heavy-hand of the First Age).
We don't know this, and Tolkien never elaborated on it. So it would be a matter of speculation whether or not the Dúnedain of the South are of high lineages.
They would be placed third after Faramir and Imrahil because:
- Their ancestry is uncertain
- They are not of the royalty of Gondor
Dúnedain of the North
They would come under the same 'speculation group' as the Dúnedain of the South. We just don't know enough about them to say that they are of high lineages, though doubtless they would have been descended from Isildur Elendil's son of Arnor, making them possible candidates to the throne of Gondor, though, as like Dírhael, they wouldn't be popular in Gondor.
One named Dúnedain of the North would be Halbarad the Ranger. He is known to have been a 'kinsman', as were all the Dúnedain of the North, of Aragorn.
'All is well,' said Aragorn, turning back. 'Here are some of my own kin from the far land where I dwelt. But why they come, and how many they be, Halbarad shall tell us.'
They would be placed last after Faramir, Imrahil, Dúnedain of the South because:
- Their ancestry is uncertain
- They aren't popular in Gondor
Factors that give one the right to the Kingship
In Gondor, the last of the official line of the Kings of Gondor descended from Anárion was Eärnur.
Eärnur had held the crown only seven years when the Lord of Morgul repeated his challenge, taunting the king that to the faint heart of his youth he had now added the weakness of age. Then Mardil could no longer restrain him, and he rode with a small escort of knights to the gate of Minas Morgul. None of that riding were ever heard of again. It was believed in Gondor that the faithless enemy had trapped the king, and that he had died in torment in Minas Morgul; but since there were no witnesses of his death, Mardil the Good Steward ruled Gondor in his name for many years.
Thus, when Earnur returned not, it follows as such that no other descendant challenged the Stewards for the throne. Mentioned here:
Now the descendants of the kings had become few. Their numbers had been greatly diminished in the Kin-strife; whereas since that time the kings had become jealous and watchful of those near akin. Often those on whom suspicion fell had fled to Umbar and there joined the rebels; while others had renounced their lineage and taken wives not of Númenórean blood.
So it was that no claimant to the crown could be found who was of pure blood, or whose claim all would allow.
Therefore, the factors that give one the right to the Kingship would be: having pure blood (arguably high lineage as well) and being popular in Gondor. These are the reasons why Aragorn was made the King, excellently explained here.
Note: if there were any who felt that their claim was strong enough, they would have challenged the rule of the Stewards prior to Aragorn's arrival and Eärnur's death (26 of them). No challenges were made during Denethor's rule. Not only that, any possible candidate would have also challenged Aragorn's claim to the crown. Seeing that none resisted Aragorn's claim, you could say that there was no one who had as strong a claim as Aragorn's on the Crown of Gondor.
1: Denethor is known as the Lord of Gondor because he is the Steward of the High King of Gondor and rules from the capital city Minas Tirith. Imrahil is given the title of 'Prince' as he is only in-charge of his city Dol Amroth, whereas Denethor is in-charge of the whole of Gondor.