Jamie Vincent scored on his debut and on-loan defender Rob Edwards added a second to give Derby victory.
Vincent's free-kick gave Derby the lead after 14 minutes and Edwards scored from 20 yards after the break.
Gillingham were reduced to nine men after John Hills and Ian Cox were sent off for two bookable offences either side of half-time.
And even though Tommy Johnson's long-range effort pulled a goal back late on, Derby deserved the win.
Derby took the lead when Marcus Tudgay was fouled on the edge of the area and Vincent, a free-transfer
recruit from Portsmouth, curled a terrific left-foot free-kick round the wall and into the top left corner of the net.
Gillingham's task was made even harder in the 36th minute when Hills was sent off for his second bookable offence, pulling back Manuel Mane.
Few inside Pride Park were surprised when Derby doubled their lead in the 62nd minute. Costa's corner was only partially cleared by Nyron Nosworthy and the ball fell 25 yards out to Edwards, whose shot took a bobble but still
found its way past Vaesen.
Johnson gave Gillingham hope after 70 minutes, but another red card halted a potential revival.
With 13 minutes left Cox was sent off by referee Ian Wright having committed two bookable offences in two minutes, leaving the Rams able to play out time to
secure the points.
Derby: Grant, Edwards, Mawene, Johnson, Vincent, Costa, Taylor,
Huddlestone, Reich, Manel, Tudgay.
Subs: Camp, Jackson, Bolder,
Holmes, Labarthe Tome.
Gillingham: Vaesen, Nosworthy, Cox, Hope, Hills, Smith,
Spiller, Saunders, Tommy Johnson, Henderson, Agyemang.
Bossu, Hessenthaler, Leon Johnson, Crofts, James.
Referee: K Wright (East Anglia).