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
Here's how the weather is looking for Christmas Day across the East & West Midlands.
Staffordshire County Council is warning parents who buy their children smartphones to take precautions to keep them safe online.
The National Crime agency has issued details of their most wanted fugitives, who could be back in the Midlands this Christmas.