The 19-year-old striker took his tally to seven for the season as Middlesbrough go eight points clear at the top following their winning start.
Stoke took the lead on 32 minutes, when Nathan Guru brought down Tyrese Campbell in the box and the latter tucked away his penalty.
Miller grabbed his first of the evening on 68 minutes, rising highest to nod in a free-kick from Lewis Wing.
With three minutes remaining, Miller reacted to a loose ball and poked in from close range.
Middlesbrough are next against Reading on Sunday 15 October, while Stoke are at Fulham two days earlier.