Your attack bonus is still affected by the personal cost of Merthuvial, even when under the effect of divine power.
The personal cost description in Weapons of Legacy for legacy items reads, in part:
In addition to performing a ritual and paying its gp cost, you must pay personal costs to use a legacy item’s ability. [...] Personal costs are permanent[.] [...] [p]ersonal costs are assessed permanently, whether or not you have the item in your possession. The only way to recover a personal cost is to destroy or renounce the legacy item (see below). (p. 9)
This is further expanded on page 24:
Attack Penalty: This is a permanent penalty on all your attack rolls. Multiple values in the same column are not cumulative, instead representing the total penalty applied.
While divine power does "set" your Base Attack Bonus instead of adding a modifier to it, the personal cost of the legacy item still persists - a final, end-point penalty. The cost of using the Merthuvial is technically not adjusting or affecting your Base Attack Bonus, instead simply applying an "Attack Penalty" at the proscribed levels.
If a character could find a way to avoid (even temporarily!) the personal cost of their legacy item, then the item would no longer offer the abilities corresponding to the cost(s) being avoided, since "you must pay personal costs to use a legacy item’s ability."
In the case of Merthuvial, finding a clever way to avoid paying the attack penalty would subsequently limit the bonuses offered to those seen in levels 5 through 8 on the "Penalties and Abilities" chart (Barrow of the Forgotten King, p. 21).
All that aside...
For what it's worth, this respondent feels it appropriate to remind you that legacy items have been annoying players and DMs for over a decade now. While there is a great deal of consternation regarding the source, Weapons of Legacy, there is no wrong way to play this game, so long as it is enjoyable. If your table arrives at a distinct conclusion from this answer, that's probably better. Only your table can know the exact vagaries and details of your game and players. If your table rules that the costs from Merthuvial can be avoided using magic, that's awesome. If your table proceeds in a more-or-less rules pure manner, you might decide that there are a head-ache inducing number of edge cases where a "cost" can be paid, yet a "penalty" cleverly avoided - such cases may require a houserule to simplify the manner in which Merthuvial (and other legacy items) assess their costs and penalties. That's fantastic.
Experience tells me that Items of Legacy, should your adventures continue to take you to such territory, will likely require some kind of houseruling at one point or another. Have a discussion with the table about what material from Weapons of Legacy you find helpful or appropriate for your table, and modify or discard the material your table finds troublesome or outright confusing. User @KRyan suggests reading the relic related material found in Book of Exalted Deeds - pages 36 - 40. He also suggests reading the relic related material found in Magic Item Compendium, though the relics in that book are somewhat scattered. The book's relics specific section starts on page 221.