The two sold 180 bags of rice donated by an international aid agency, the court in Maiduguri, Borno State, heard.
They were jailed for two years and fined 1m naira ($3,200; £2,500) each.
More than two million people have been displaced in north-eastern Nigeria where security forces are battling Islamist militant group Boko Haram.
The prosecution of the two officials was brought by Nigeria's anti-corruption agency, the EFCC.
Umar Ibrahim, a local councillor, and Bulama Ali Zangebe, a member of a camp feeding committee, are said to be the first convicted for corruption in relation to food aid in Nigeria since the insurgency began in 2009.
The rice had been donated by the Danish Refugee Council for victims of insurgency in the town of Mafa, and had been marked as not for sale.
The two admitted the charges against them but told the court that the rice was about to expire.
President Muhammadu Buhari took office in 2015 with a pledge to root out corruption in government.
Last month his office ordered an investigation after the head of the national intelligence agency was suspended over corruption allegations.
He acted after anti-corruption officers found more than $43m (£34m) in a flat in the main city, Lagos.