The singer, who has supported the Rams since he was four, was being filmed at Pride Park for a new film being made about the boy-band.
The film is being directed by Morgan Spurlock, who is the documentary maker behind Supersize Me, where he ate nothing but fast food for 30 days to see what effect it had on his health.
Niall had a kick-about on the pitch with some of his friends before the game kicked off, but no other members of the group were there.
More top news
A dry day across the region with bright or sunny spells after a frosty start. However, cloud will tend to increase from the west by evening.
After a cold, bright and frosty start, skies will gradually turn cloudier through the afternoon. However, it will stay dry with light winds.
An engineer has been confirmed dead in the crash in Wales. The RAF say the pilot survived and is receiving treatment.