Methane
Methane is a powerful but relatively short lived greenhouse gas.  Averaged over 100 years, the global warming potential of one tonne of methane is 25 times that of one tonne of carbon dioxide.
In New Zealand, most methane comes from belching by ruminant animals: sheep, beef cattle, dairy cows, and deer, and some from animal manure. Non-ruminants, such as poutry and pigs also produce methane from their manure but these constitute a very small source in New Zealand.
Nitrous oxide
Nitrous oxide is a much more powerful greenhouse gas than methane - 298 times more powerful than carbon dioxide over a 100 year timeframe on a per tonne basis.  See Global warming potential
Fortunately, the absolute amount of nitrous oxide emitted from agriculture is lower than methane. In New Zealand, most nitrous oxide is produced by the action of soil bacteria in urine patches in paddocks.  Smaller amounts come from dung deposited during grazing, stored manures spread back onto pasture, and from nitrogen fertilizer.