Background: Gamow-Teller (GT) transition strength distributions in stable and unstable pf-shell isotopes are key inputs for estimating electron-capture rates important for stellar evolution. Charge-exchange experiments at intermediate beam energies have long been used to test theoretical predictions for GT strengths, but previous experiments were largely restricted to stable nuclei. Since a large fraction of the nuclei relevant for astrophysical applications (including key nuclei such as 56Ni) are unstable, new methods are needed to perform charge-exchange experiments in inverse kinematics with unstable isotopes. Purpose: The 56Ni(p,n) and 55Co(p,n) reactions were measured in inverse kinematics in order to extract GT strengths for transitions to 56Cu and 55Ni, respectively. The extracted strength distributions were compared with shell-model predictions in the pf shell using the KB3G and GXPF1J interactions. By invoking isospin symmetry, these strength distributions are relevant for electron captures on the ground states of 56Ni and 55Ni to final states in 56Co and 55Co, respectively. Method: Differential cross sections and excitation energy spectra for the 56Ni(p,n) and 55Co(p,n) reactions were determined by measuring neutrons recoiling from a liquid hydrogen target into the Low Energy Neutron Detector Array. GT contributions to the spectra were extracted by using a multipole decomposition analysis and were converted to strengths by employing the proportionality between GT strength and differential cross section at zero linear momentum transfer. Results: GT strengths from 56Ni and 55Co were extracted up to excitation energies of 8 and 15 MeV, respectively. Shell-model calculations performed in the pf shell with the GXPF1J interaction reproduced the experimental GT strength distributions better than calculations with the KB3G interaction. Conclusions: A new technique for measuring (p,n) charge-exchange reactions on unstable nuclei was successfully developed. It can be used to study the isovector response of unstable nuclei in any mass region and for excitation energies beyond the particle decay threshold. In the first experiment, 56Ni(p,n) and 55Co(p,n) reactions were studied and GT transition strengths were extracted for the purpose of testing shell-model calculations used to estimate electron-capture rates in simulations of late stellar evolution. The calculation using the GXPF1J interaction was found to best reproduce the experimental strength distribution.