Giroud's deflected finish in the 89th minute was rough on Preston who had dominated the opening period after Callum Robinson had given them an early lead.
Arsenal were a different proposition after the break and equalised a minute after the restart when Ramsey fired home from the edge of the area after Alex Iwobi's lay-off.
The hosts looked capable of holding out for a replay but Giroud struck for the fourth match in a row when he capitalised on a clever back heel by Lucas Perez.
Preston were left to rue missed chances before the break, the best of which saw Jordan Hugill somehow fail to connect with a Robinson cross with the goal gaping.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
Robinson also had a goal ruled out for an infringement.
(Reporting by Martyn Herman, editing by Pritha Sarkar)
