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
Four-day Harley Davidson event at Lincolnshire Showground begins today with thousands expected to attend
David 'Piggy' Powell has been at Northampton Saints for half a century - a former player, former coach and since the late 80s, groundsman.
Rather cloudy with patchy rain at first. Clear spells developing.