The earliest NRT-ORD flight is at 10:45 AM. If I were on that flight, I would spend the night near Ueno or Tokyo station and plan on catching a train or bus around 7:30 AM to Narita. If the flight is later then adjust the schedule accordingly.
From Ueno station you can take the Keisei Skyliner train. From Tokyo station you can take the Narita Express train or Keisei/Heiwa Kotsu bus.