In a scrappy match punctuated with handling errors, the home side's pack dominated proceedings playing into in a stiff second half breeze to allow the Magpies to claim their second win of their campaign.
Hawke's Bay, after a sloppy opening 40 minutes with the wind at their backs, took a tenuous 13-6 edge into the second half but controlled the match from the resumption to score two tries to one.
The hosts welcomed back the Samoan trio of Kane Thompson, Kahn Fotuali'i and prop Anthony Perenise after their upset win over Australia the Magpies took an early 6-0 after two Andrew Horrell penalties.
But then they were guilty of turning over possession on a regular basis to allow the Razorbacks to control possession and fullback Glenn Dickson got them back on level terms with two penalties handy to the posts.
Horrell was denied a try after being held up over the line, but prop Sona Taumalolo rectified matters minutes later to drive over and give Hawke's Bay a lead at the break.
Otago went into the match unbeaten after wins over North Harbour and Auckland and took advantage of some errant kicking from the Magpies to hold 64 percent of the possession at the interval despite leaving veterans Tony Brown and Kees Meeuws on the bench.
Meeuws entered the fray after the break to help shore up a shaky Otago scrum, but it was the home side's forwards that helped provide the impetus for first five-eighth Dan Kirkpatrick to cross after a burst from centre Tua Saseve.
Replacement Otago loose forward TJ Ioane then laid on a try for wing Joe Hill to cut the margin to seven points, but after a well-worked backline move Fotuali'i darted over under the uprights to double the lead for the home side.
The Magpies' forwards replicated what Otago had done to them in the first half, to deny Brown and All Blacks utility back Ben Smith, both second half replacements, the chance to impose themselves on the match and consign the visitors to their first loss of the season.