Using a sample of dilepton top-quark pair (tt¯) candidate events, a study is performed of the production of top-quark pairs together with heavy-flavor (HF) quarks, the sum of tt¯+b+X and tt¯+c+X, collectively referred to as tt¯ + HF. The data set used corresponds to an integrated luminosity of 4.7 fb-1 of proton-proton collisions at a center-of-mass energy of 7 TeV recorded by the ATLAS detector at the CERN Large Hadron Collider. The presence of additional HF (b or c) quarks in the tt¯ sample is inferred by looking for events with at least three b-tagged jets, where two are attributed to the b quarks from the tt¯ decays and the third to additional HF production. The dominant background to tt¯ + HF in this sample is tt¯+jet events in which a light-flavor jet is misidentified as a heavy-flavor jet. To determine the heavy- and light-flavor content of the additional b-tagged jets, a fit to the vertex mass distribution of b-tagged jets in the sample is performed. The result of the fit shows that 79 ± 14 (stat) ± 22 (syst) of the 105 selected extra b-tagged jets originate from HF quarks, 3 standard deviations away from the hypothesis of zero tt¯ + HF production. The result for extra HF production is quoted as a ratio (RHF) of the cross section for tt¯ + HF production to the cross section for tt¯ production with at least one additional jet. Both cross sections are measured in a fiducial kinematic region within the ATLAS acceptance. RHF is measured to be [6.2±1.1(stat)±1.8(syst)]% for jets with pT>25 GeV and |η|<2.5, in agreement with the expectations from Monte Carlo generators.