The military said the strike took place after a midnight Christmas Eve service early on Tuesday outside the town of Potiskum in north-eastern Yobe state, where radical sect Boko Haram has carried out several attacks this year.
"Unknown gunmen attempted to attack Potiskum but were repelled by the troops. While they were fleeing, they attacked a church in a village known as Jiri," said military spokesperson Eli Lazarus, who confirmed that six people were killed.
Members of Boko Haram, who want to impose Sharia law in north Nigeria, have killed hundreds.
The group killed dozens in a series of bombings across north Nigeria on churches on Christmas Day last year, mirroring similar attacks in 2010 which killed more than 40.
This year the police and army pledged to protect churches, boosting security in major northern towns and cities and restricting people's movement.
At least 2 800 people have died in fighting in the mostly Muslim north since Boko Haram launched an uprising against the government in 2009, watchdog Human Rights Watch reported.
Potiskum, which lies in Boko Haram's north-east stronghold, was one of the areas worst affected by the insurgency.
Security experts believe Boko Haram was targeting worshippers to spark a religious conflict in a country of 160-million people split roughly equally between Christians and Muslims.
Many churches in Nigeria's biggest northern city, Kano, and elsewhere in the north were almost empty for Christmas Day services on Tuesday, local residents said.
Two people were killed in separate attacks on Tuesday in Kano, a police source said. He said gunmen riding motorcycles killed the driver of a government worker and another civilian.
Pope Benedict used part of his Christmas message to the world on Tuesday to highlight the need for reconciliation in Nigeria, saying "savage acts of terrorism continue to reap victims, particularly among Christians".