To which god did Lord Ram pray

Why did Lord Rama pray to the sea god when he had Nala and Neela to help him?

I do not know the source of the story quoted in the question about Nala and Neela. As far as I understand, Valmiki's Srimad Ramayana does not contain this story.

When I come to the question of the need to pray the god of the sea when Nala was very available on Sri Rama's side, my answer is as follows:

Here we need to understand 2 points.

1) Construction of a massive bridge for a length of 100 yojanas, i.e. 100 x 13 km = 1,300 km (as 1 yojana = 13 km)

2) Sea God permission for Vanaras to pass through the sea.

I) On the advice of Vibhishana, Sri Rama began to pray the god of the sea for the safe passage of the army.

उपायैर् अभिगच्चामो यथा नद नदी पतिम् || ६-१९ -२ २ तराम तराम तरसा सर्वे ससैन्या आलयम् |

"How are we to quickly cross the sea with the army, Lord of the streams and rivers, and arrive at this strategy?"

एवम् उक्तस् तु धर्मज्ञः प्रत्युवाच विभीषणः || ६-१९ -३० ३० राघवो राघवो राजा शरणम् गन्तुम् |

Hearing her words, the sane Vibhishana replied, "It is fitting that Prince Rama should seek the ocean as his refuge."

अबद्ध्वा सागरे सेतुम् घोरे अस्मिन् वरुण आलये || ६-१९ -३ ३ लंका लंका आसादितुम् शक्या शक्या इन्द्रैर् अपि अपि असुरैः |

"Without building a bridge over this fiery ocean, which is the abode of Lord Varuna, even the celestials and demons along with Indra cannot reach the city of Lanka."

एवम् उक्तः कुश आस्तीर्णे तीरे नद नद पतेः | सम्विवेश तदा रामो वेद्याम् इव हुत अशनः || ६-१९ -४२

After Rama was admonished in this way, he was sitting on the ocean shore covered with blades of Kusha grass as the god of fire climbed the altar.

To appease the sea god, Sri Rama prayed to him.

Then the sea god told the way to cross it.

विधास्ये येन गन्तासि विषहिष्ये ह्यहम् तथा | न ग्राहा विधमिष्यन्ति यावत्सेना तरिष्यति || २-२२-२८ हरीणाम् तरणे तरणे राम यथास्थलम् |

"O Rama! I will make it possible to see that you can cross. I will arrange a place for the monkeys to cross and carry me. As far as the army crosses me, the crocodiles will not be aggressive towards them." "

II) Regarding the second part of the question: Sri Rama does not know that Nala, the son of Viswakarma, who is on his side, is just like his father a great architect.

It was the sea god who said to use the services of Nala.

अयम् सौम्य नलो नाम तनुजो विश्व कर्मणः | पित्रा दत्त वरः श्रीमान् प्रतिमो विश्व कर्मणः || २-२२-४४

"O, excellent man! This one, called Nala, a splendid person, is the son of Vishvakarma; who has received a blessing from his father and is equal to Visvakarma."

एष सेतुम् महाउत्साहः करोतु मयि वानरः | तम् अहम् धारयिष्यामि तथा हि एष यथा पिता || २-२२-४५

"Let this very energetic monkey build a bridge over me. I can hold that bridge. He's just like his father."