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
New Zealand batsman Martin Guptill will return to Derbyshire CCC as an overseas signing for the early part of the 2015 season.
A Birmingham man suspected of murdering two pensioners - including an 80-year-old Halesowen woman - has been found dead in his prison cell.
Sunny spells on Monday will give way to showers later in the week