SB 10.67.2

śrī-śuka uvāca
narakasya sakhā kaścid
 dvivido nāma vānaraḥ
sugrīva-sacivaḥ so ’tha
 bhrātā maindasya vīryavān
Synonyms: 
śrī-śukaḥ uvāca — Śukadeva Gosvāmī said; narakasya — of the demon Naraka; sakhā — friend; kaścit — a certain; dvividaḥ — Dvivida; nāma — by name; vānaraḥ — an ape; sugrīva — King Sugrīva; sacivaḥ — whose adviser; saḥ — he; atha — also; bhrātā — the brother; maindasya — of Mainda; vīrya-vān — powerful.
Translation: 
Śrī Śukadeva Gosvāmī said: There was an ape named Dvivida who was a friend of Narakāsura’s. This powerful Dvivida, the brother of Mainda, had been instructed by King Sugrīva.
Purport: 

Śrīla Jīva Gosvāmī points out some interesting facts about the ape Dvivida. Although Dvivida was an associate of Lord Rāmacandra’s, he later became corrupted by bad association with the demon Naraka, as stated here: narakasya sakhā. This bad association was the reaction for an offense Dvivida had committed when, being proud of his strength, he disrespected Lord Rāmacandra’s brother Lakṣmaṇa and others. Those who worship Lord Rāmacandra sometimes chant hymns addressed to Mainda and Dvivida, who are attendant deities of the Lord. According to Śrīla Jīva Gosvāmī, the Mainda and Dvivida mentioned in this verse are empowered expansions of these deities, who are residents of Lord Rāmacandra’s Vaikuṇṭha domain.

Śrīla Viśvanātha Cakravartī Ṭhākura concurs with Śrīla Jīva Gosvāmī’s view that Dvivida was ruined by bad association, which was a punishment for his having disrespected Śrīmān Lakṣmaṇa. Śrīla Viśvanātha Cakravartī states, however, that the Mainda and Dvivida mentioned here are actually the eternally liberated devotees addressed as attendant deities during the worship of Lord Rāmacandra. The Lord arranged their degradation, he says, to show the evil of the bad association that results from offending great personalities. Thus Śrīla Viśvanātha Cakravartī compares the fall of Dvivida and Mainda to that of Jaya and Vijaya.