A 67-year-old man with a history of heavy NSAID use presents with melena, lightheadedness, and epigastric discomfort. Vitals: BP 92/60 mm Hg, HR 118. He appears pale; hemoglobin is 7.8 g/dL. After initial resuscitation with IV fluids and blood transfusion, what is the most appropriate next step in management?