Dunivant's tally in the 61st minute came when he headed in a David Beckham corner kick.
Portland argued goalkeeper Troy Perkins had been interfered with on the play, but the tally was allowed to stand and the Galaxy (4-8-2) hung on to notch their first win since April 21.
The Timbers (3-6-4), meanwhile, suffered their first loss since April 28.
They remain tied with FC Dallas for last place in the Western Conference, while the Galaxy climbed out of the cellar.
Benedict Cumberbatch's dramatic reading of R. Kelly lyrics is just what you need
Couple mistakenly served bag of cash at McDonald's drive-thru