The hosts began the final day on 162 for three and looked well placed to score the remaining 159 to win, but experienced seamer Harris sent back fellow countryman Dan Christian for 46 and pinned Benny Howell lbw for a golden duck to make it 169 for five.
From then on the tourists looked the more likely winners in overcast conditions and, despite an encouraging sixth-wicket stand between Gareth Roderick (33) and Will Gidman (19), the county were bowled out for 296, James Fuller contributing a brisk 38 near the end.
Harris returned three for 56 and Jackson Bird three for 53, while Chadd Sayers finished with three for 68 for match figures of eight for 92.
Harris's two quick strikes were major setbacks as Christian had blasted six fours and three sixes in his 62-ball knock and Howell had top-scored in Gloucestershire's first innings. Roderick and Gidman revived home hopes by playing positively in their partnership of 42 before Gidman was bowled off stump by a full ball from Bird with the total on 211.
Without addition, Roderick fell to a spectacular catch by Fawad Ahmed at mid-on, one-handed above his head, to give left-arm spinner Ashton Agar a wicket in his first over.
Fuller held up the tourists with some aggressive stroke-play, adding 48 in 11 overs with Cameron Herring before he was then squared up by Bird, who produced a lively spell from the Pavilion End, and had the wicketkeeper caught at third slip by Jordan Silk for nine.
Fuller had faced 39 balls and hit six fours and a six when his enterprising innings was brought to an end by a sharp catch at second slip from Steve Smith, giving Harris a third wicket.
An entertaining game, which will be best remembered for Nic Maddinson's spectacular 181 in Australia A's first innings, ended when last man Liam Norwell was caught behind off Sayers for 16, having added 36 for the final wicket with Tom Smith (17 not out)
The pair almost extended the game beyond the lunch interval, which was put back half an hour because nine wickets were down. Ahmed failed to take a wicket sending down 22 overs in the second innings and the leg-spinner's match figures of one for 100 did little to advance his claims for an Ashes place.