Attach to the database as the owner of the relevant table or stored procedure. Find the relevant table or stored procedure in the system tables RDB$RELATIONS (tables), RDB$PROCEDURES, and... Then modify the column RDB$OWNER_NAME to reflect the new owner.
Important
As of Firebird v3.0, direct modification of system tables is not allowed. So the given solution only works for Firebird up to version 2.5!