High-energy emission from a magnetar giant flare in the Sculptor galaxy